Kryptronic Software Support Forum

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.

#1 09-02-2012 00:58:09

Aircut
Member
Registered: 09-22-2003
Posts: 235
Website

Different wording on the Add to cart button based on Categories

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

 

#2 09-02-2012 10:04:22

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19798
Website

Re: Different wording on the Add to cart button based on Categories

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:

Code:

print '<p><input class="formbutton" type="submit" name="SUBMIT" id="' . $formid . '--SUBMIT" value="Add to Cart" />';

To something like this:

Code:

$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 . '" />';

Nick Hendler

Offline

 

#3 09-02-2012 14:39:51

Aircut
Member
Registered: 09-22-2003
Posts: 235
Website

Re: Different wording on the Add to cart button based on Categories

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 smile)

Thanks again

Offline

 

#4 09-03-2012 07:16:57

Aircut
Member
Registered: 09-22-2003
Posts: 235
Website

Re: Different wording on the Add to cart button based on Categories

Nick, It did not work ;-((

I used

Code:

$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

 

#5 09-03-2012 12:38:59

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19798
Website

Re: Different wording on the Add to cart button based on Categories

I just edited your code so it reads how it should.


Nick Hendler

Offline

 

#6 09-03-2012 22:42:18

Aircut
Member
Registered: 09-22-2003
Posts: 235
Website

Re: Different wording on the Add to cart button based on Categories

thanks. that worked !

Offline

 

Board footer