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?
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"
You must log in to post.