Sorry to bump but I really need some advice with the problem above, I can't go live until it's fixed and I'm completely stumped.![]()
Hi Webstar, thanks a lot for the advice, I really appreciate it. Removing the button is not really an option, the site is very much geared towards quickpay.
I have tried the first mod in your post above (1272) - it's not exactly the problem I was having but hey, worth a go I thought. Now last night I'm 100% sure my problem was as described above, 'checkout' looped back correctly, 'quick pay' incorrectly proceeds to PayPal. I tried your mod and noticed that then neither button looped back: both proceeded to checkout. So I reverted back to my original version... but (very) strangely both buttons still checkout instead of looping! I'm well aware that this is impossible if I simply changed the code and then changed it back... but that's really what it seems like! Not sure what I've done here.
So currently both my buttons proceed to checkout when an out of stock product with attributes is in the basket. I've also just noticed that this is only the case when there is 1, 2 or 3 products. If I increase the amount to 4 or more the buttons begin to work as they should and both correctly loop back to the basket.
Weird. I'm going crazy here. Thanks again.
In an act of desperation I have turned off QuickPay but the Checkout button still allows me to proceed. Could somebody please do me a favour and list the files that are involved in this process? I plan to replace what I'm using with original versions and see what happens.
Thinking about it my cart is definitely checking the stock and it is able to loop back to the cart... as it does this fine when there are 4 or more out of stock items... i'm thinking maybe the code that specifically tests the numbers has got messed up somehow? Eg, if amount is basket > amount in stock or something. Or whatever it is the cart does. Where can I find this code?
Another update, it has become clear my problem above is caused by stock numbers for all attributes on a product being added together somewhere causing my stock levels to be wrongly represented in the cart.
Eg: On a product I have 3x small 2x medium and no large. If I add a large to the cart it is correctly flagged as out of stock but both buttons allow checkout. If I increase the amount in the cart to 5 (3small+2medium) I can still checkout. If I increase to 6, both Checkout and QuickPay both behave correctly and loop back. The Out Of Stock warning always shows correctly, the issue is only on the buttons.
This is also the case when adding in-stock items, I can chackout 5 or less of any size/attribute becuase of their total number.
Hopefully this clears things up a a little?
CheekyCockney wrote:
Not sure what version you're using. I use 1.4.9 Ajax with no troubles.Eg: On a product I have 3x small 2x medium and no large. If I add a large to the cart it is correctly flagged as out of stock but both buttons allow checkout. If I increase the amount in the cart to 5 (3small+2medium) I can still checkout. If I increase to 6, both Checkout and QuickPay both behave correctly and loop back. The Out Of Stock warning always shows correctly, the issue is only on the buttons.
Just wondering if your admin settings are muddying your waters:
Do you have admin/configuration/stock/allow checkout set to 'false' disallow checkout with insufficient stock.
And/or if:
In your product description(s) you have 'Minimum Purchase' set to greater than 1.
I apologize if I'm stating obvious.
No need to apologise, thanks for the input. The sollution could well be obvious! But yes, stock settings are as they should be and minumum purchase (Product Qty minimum I think we're talking about?) is set as 1. My cart is 1.3.9, stock by atts 1.4.12 with a couple of bug fixes as stated above.
Looking at my product description in the admin I can see it adds all the attribute stock levels together and labels it 'Product Quantity'. I guess this is normal and sort of makes sense but I beleieve my cart is testing this stock level and not the attribute levels. Maybe one of my bug fixes or something reverted this code back to the pre-attribute mod version?
Thanks again.
zen 1.3.9h
Stock By Attributes - Current New Version
My stock by attributes works A OK.
This post is about attribute image in cart.
I only have one mod SBA thats why im posting here.
I added some script to the shoppin_cart class file:
includes/classes/mytemplate/shopping_cart.php at line 1193.
It works fine on my test store that has no mods. On my liveCode://webstar mod here // support attribute images webstar if (isset($this->contents[$products_id]['attributes'])) { foreach ($this->contents[$products_id]['attributes'] as $options_id => $options_values_id) { // get the attributes image using the options_id and options_values_id $attributes_image = $db->Execute("SELECT attributes_image FROM " . TABLE_PRODUCTS_ATTRIBUTES . " WHERE products_id = " . (int)$products_id . " AND options_id = " . $options_id . " AND options_values_id = " . $options_values_id . " LIMIT 1;"); if ($attributes_image->RecordCount() > 0 && $attributes_image->fields['attributes_image'] != '') { $products->fields['products_image'] = $attributes_image->fields['attributes_image']; break; } } } //end support attribute images webstar
store that has Stock By Attributes installed it won't work.
I was woundering if maybe Stock By Attributes is over riding
my script some how. Anybody have any ideas?
I found the script from a blog;
How to display attribute images on the Zen Cart shopping cart page http://www.numinix.com/blog/2011/05/...ing-cart-page/
Bookmarks