You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.
Pages: 1
we sell both tentative goods and digital downloads.
is it possible to have different wording on the add to carts button based on the categories
for example for tentative goods "add to cart:
for the ebooks "download this ebook"
thanks in advance.
Last edited by Aircut (09-02-2012 00:59:03)
Offline
You will see the submit buttons printed in the product detail display, which is edited under Store > Store Displays > Product Detail Displays. You could easily change the name of the button as follows:
Change the code:
print '<p><input class="formbutton" type="submit" name="SUBMIT" id="' . $formid . '--SUBMIT" value="Add to Cart" />';
To something like this:
$buttonname = 'Add to Cart'; $buttonnames = array('ebook' => 'Download This eBook', 'hotrods' => 'Buy This HotRod'); foreach ($buttonnames as $catid => $newname) { if (preg_match('/' . preg_quote($catid,'/') . '/',$proddisp['xcat'])) {$buttonname = $newname;} } // End of foreach statement. print '<p><input class="formbutton" type="submit" name="SUBMIT" id="' . $formid . '--SUBMIT" value="' . $buttonname . '" />';
Offline
You are the man Nick! I can't wait to give it a try! The more I use version 8 the more I like it, I am a loyal customer since 2003 and looking forward for future updates. I will probably have some more questions and suggestions for future features. Please bear with me, once all is running smoothly I will go lurking again )
Thanks again
Offline
Nick, It did not work ;-((
I used
$buttonname = 'Add to Cart'; $buttonnames = array('books' => 'Buy the Book', 'dab' => 'Buy the eBook', 'eBooks-pdf' => 'Buy the PDF'); foreach ($buttonnames as $catid => $newname) { if (preg_match('/' . preg_quote($catid,'/') . '/',$proddisp['xcat'])) {$buttonname = $newname;} } // End of foreach statement. print '<p><input class="formbutton" type="submit" name="SUBMIT" id="' . $formid . '--SUBMIT" value="' . $buttonname . '" />';
I guess there is a syntax error somewhere because the button does not show up at all.....
Offline
Pages: 1