- This topic has 3 replies, 2 voices, and was last updated 14 years, 10 months ago by .
Viewing 4 posts - 1 through 4 (of 4 total)
Viewing 4 posts - 1 through 4 (of 4 total)
- You must be logged in to reply to this topic.
Support site for Tips and Tricks HQ premium products
by
Tips and Tricks HQ Support Portal › Forums › Simple PayPal Shopping Cart › Simple shopping Cart Usage › Change text on 'Add To Cart' button
Tagged: add to cart button, button
Hi there,
Is there a way to make the text on the ‘Add to Cart’ button reflect the price that I have given to it?
Or alternativley is there any way of turning the button into a text link?
You want to put the Price inside the button (as the text of the button)? If you want this then it should be doable quite easily. A button has the following code:
echo ‘<input type=”submit” value=”Add to Cart” />’;
the text inside the “value” is what gets displayed on the button so all you have to do is put the price there instead of the text “Add to Cart”. something like the following should achieve it:
echo ‘<input type=”submit” value=”‘.$price.'” />’;
Sorry about this but I am a bit of a noob when it comes to editing PHP!
I assume that I am looking for the line echo ‘<input type=”submit” value=”Add to Cart” />’; in the wp_shopping_cart.php file?
I can’t seem to find it. is there any chance that you could give me a line number to edit?
Thanks
Martin
Search for the following line
$replacement .= '<input type="submit" value="'.$addcart.'" />';
and change it to
$replacement .= '<input type="submit" value="'.$price.'" />';
This is in the “wp_shopping_cart.php file”