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 06-23-2017 11:01:03

jonaha
Member
Registered: 11-01-2006
Posts: 192

Add To Cart Button

I have a lot of options on the page and would like to add an add to cart button towards the quantity in addition to the bottom of the page. Is this possible. I did it in V8.

https://www.foldingbed.net/K9/index.php … f=352STDln

Offline

 

#2 06-23-2017 11:02:36

jonaha
Member
Registered: 11-01-2006
Posts: 192

Re: Add To Cart Button

This is the way it is in V8
https://www.foldingbed.net/Item/352STDln

Offline

 

#3 06-26-2017 08:22:57

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

Re: Add To Cart Button

Yes, edit the {private}/apps/ecom/ECOM/includes/prodshow.php file.  You'll see where the buttons are printed at the bottom, replicate something like that at the top of the form.


Nick Hendler

Offline

 

#4 06-26-2017 12:43:59

jonaha
Member
Registered: 11-01-2006
Posts: 192

Re: Add To Cart Button

Thank you. I am sorry, I can not figure out which is the code for the button only. Would you be able to give it to me?

Offline

 

#5 06-27-2017 05:00:29

zanart
Member
From: bedford
Registered: 04-02-2008
Posts: 1706

Re: Add To Cart Button

HI

The line of code for the add to cart button is

Code:

print '<div class="ktopmarginfull"><input type="submit" class="' . $buttonclass . '" name="SUBMIT" id="' . $formid . '--SUBMIT" value="Add to Cart" onclick="jQuery(\'#' . $formid . '--SUBMITVALUE\').val(\'CART\');" /></div>';

You would need to check both variable are declared in the code before the new button, $buttonclass and $formid, and you would need to change the id so you don't have two id's the same.


Rob

Offline

 

#6 06-27-2017 08:00:47

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

Re: Add To Cart Button

You would need to check both variable are declared in the code before the new button, $buttonclass and $formid, and you would need to change the id so you don't have two id's the same.

Plus change the id of the button so it's unique.


Nick Hendler

Offline

 

#7 06-27-2017 14:30:19

jonaha
Member
Registered: 11-01-2006
Posts: 192

Re: Add To Cart Button

I see that $buttonclass and $formid, is in the code. Not sure by what you mean as declared. Also, not sure how to change the id. But, the code works on the site.


https://www.foldingbed.net/K9/index.php … f=352STDln

Offline

 

#8 06-28-2017 05:14:02

zanart
Member
From: bedford
Registered: 04-02-2008
Posts: 1706

Re: Add To Cart Button

In the line of code you have id="' . $formid . '--SUBMIT"
You need to change it slightly to something like id="' . $formid . '--SUBMIT-TOP"

Currently you have two elements with the same id and this is invalid. It may cause errors or prevent the button working correctly.


If you look where the original button is coded you will see  $buttonclass = 'kaddtocart'; just above it. This declares the value of variable  $buttonclass as  kaddtocart.
You should add the same line just above the new line of code you have added. However it appears  kaddtocart is the same as the default class anyway.


Rob

Offline

 

#9 06-28-2017 09:21:16

jonaha
Member
Registered: 11-01-2006
Posts: 192

Re: Add To Cart Button

Thank you it is working well now. However, I want it to show under the quantity but can not figure out the location I should put it on the page?

Offline

 

#10 06-29-2017 08:15:43

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

Re: Add To Cart Button

There is a separate include for the quantity box.  It is {private}/apps/ecom/ECOM/includes/prodaddcart_quantity.php


Nick Hendler

Offline

 

Board footer