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.
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
This is the way it is in V8
https://www.foldingbed.net/Item/352STDln
Offline
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.
Offline
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
HI
The line of code for the add to cart button is
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.
Offline
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.
Offline
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
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.
Offline
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