| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Add to Cart Button for Out of Stock | ||||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
Add to Cart Button for Out of Stock
We are looking to make a "Special Order" button (add to cart) for out of stock items. Any direction to get this going?
Thank you
__________________
5.2.16 Cloud Search Market Price Volume Discounts |
|||||||
#2
|
|||||||||
|
|||||||||
Re: Add to Cart Button for Out of Stock
What will that button do?
__________________
Alex Solovev, Qualiteam --- User manual Video tutorials X-Cart FAQ You are welcome to press "Thanks" button if you find this post useful Click here to learn how to apply patches X-Cart Extensions |
|||||||||
#3
|
|||||||
|
|||||||
Re: Add to Cart Button for Out of Stock
It will add the item to the cart. Potentially also pop up with a message clarifying to the customer that it will be a special order.
__________________
5.2.16 Cloud Search Market Price Volume Discounts |
|||||||
#4
|
|||||||||
|
|||||||||
Re: Add to Cart Button for Out of Stock
The widget that displays the button on the product page and in the Quick Look popup is this one:
\XLite\View\Product\Details\Customer\AddButton You can alter it as follows: 1. Create a custom template in your module (skins/default/en/modules/[YOUR_DEV_ID]/[YOUR_MODULE_ID]/product/add_button/body.tpl) with the following code (it is a slightly tweaked copy of the code from the skins/default/en/product/add_button/body.tpl file): Code:
2. Decorate the widget as follows: PHP Code:
You need also a way to configure which products are regular ones, and which should display the custom button label. Depending on this you should adjust the above text. As for the popup message: do you mean the message that appears at the top of the page? If so, you should look into decorating the \XLite\Controller\Customer\Cart::doActionAdd() and other methods that it calls. As you see this may require changing a number of files, so you may be better to hire someone who could code this for you.
__________________
Alex Solovev, Qualiteam --- User manual Video tutorials X-Cart FAQ You are welcome to press "Thanks" button if you find this post useful Click here to learn how to apply patches X-Cart Extensions |
|||||||||
|
#5
|
|||||||
|
|||||||
Re: Add to Cart Button for Out of Stock
i just mean a simple message box that pops up, not the message at the top of the page. I assume that wouldn't be difficult at all. Thank you for your help, I'll see if I come up with any new questions.
__________________
5.2.16 Cloud Search Market Price Volume Discounts |
|||||||
#6
|
|||||||
|
|||||||
Re: Add to Cart Button for Out of Stock
What specifically determines whether or not the button displays? I can get it to decide what the button label is, but that doesn't help if the button does not show on out of stock products.
__________________
5.2.16 Cloud Search Market Price Volume Discounts |
|||||||
#7
|
|||||||||
|
|||||||||
Re: Add to Cart Button for Out of Stock
I believe it is the isVisible() method. However, you may also need to look into \XLite\Module\QSL\CallForPrice\View\ProductPageCol lection::getWidgetsCollection() as this method determines which widgets appear on the product page depending on different checks.
__________________
Alex Solovev, Qualiteam --- User manual Video tutorials X-Cart FAQ You are welcome to press "Thanks" button if you find this post useful Click here to learn how to apply patches X-Cart Extensions |
|||||||||
#8
|
|||||||
|
|||||||
Re: Add to Cart Button for Out of Stock
i ended up changing a function in Model/Product.php to look like this:
Code:
I had to alter a few other files to allow the item to actually be added to the cart though. the file you mentioned must be for a different version, as it does not exist. Where is the location of what the add to cart button actually does?
__________________
5.2.16 Cloud Search Market Price Volume Discounts |
|||||||
#9
|
|||||||||
|
|||||||||
Re: Add to Cart Button for Out of Stock
You're right. I copied it from a wrong file. The right method is \XLite\View\ProductPageCollection::getWidgetsColle ction().
Quote:
It submites the form with "target" = "cart" and "action" = "add". So, you should look into the \XLite\Controller\Cart::doActionAdd() method.
__________________
Alex Solovev, Qualiteam --- User manual Video tutorials X-Cart FAQ You are welcome to press "Thanks" button if you find this post useful Click here to learn how to apply patches X-Cart Extensions |
|||||||||
#10
|
|||||||
|
|||||||
Re: Add to Cart Button for Out of Stock
Quote:
Thank you, I ended up finding this not long after asking. What initializes doActionAdd()? I can't seem to get this popup code to work when the button is clicked. Code:
__________________
5.2.16 Cloud Search Market Price Volume Discounts |
|||||||
|
|||
X-Cart forums © 2001-2020
|