Page 128 of 359 FirstFirst ... 2878118126127128129130138178228 ... LastLast
Results 1,271 to 1,280 of 3589
  1. #1271
    Join Date
    Apr 2006
    Posts
    178
    Plugin Contributions
    0

    Default Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+

    I am still struggling with the problem below, I'm thinking maybe this code is dependant on specific stock settings in the admin? I say this because of the line if ( (STOCK_CHECK == 'true') && (STOCK_ALLOW_CHECKOUT != 'true') ...

    Quote Originally Posted by CheekyCockney View Post
    Hi. I have a problem which I believe may have come up before, my 'out of stock items' are able to be checked out using the PayPal Quickpay button. The normal 'Pay button' correctly loops back to the cart with an Out Of Stock message. This is only the case when my products have attributes, with all other products both buttons loop back to the cart.

    On page 70 of this thread i found this info but it doesn't seem to have made a difference.

    ****

    Similar patch for making Pay Pal Express not allow checkout with not enough stock according to SBA.

    Edit ipn_main_handler.php and find:

    Code:
    require('includes/application_top.php');

    Just below that, add the following code:

    Code:

    // Stock Check - kiddo hack
    if ( (STOCK_CHECK == 'true') && (STOCK_ALLOW_CHECKOUT != 'true') ) {
    $products = $_SESSION['cart']->get_products();
    for ($i=0, $n=sizeof($products); $i<$n; $i++) {

    unset($attributes);
    if(is_array($products[$i]['attributes'])){
    $attributes = $products[$i]['attributes'];
    } else {
    $attributes = '';
    }


    if (zen_check_stock($products[$i]['id'], $products[$i]['quantity'],$attributes)) {
    zen_redirect(zen_href_link(FILENAME_SHOPPING_CART));
    break;
    }
    }
    }

    This will not make the yellow button un-active, but will send the customer back to the shopping cart so they can change the cart contents so no out of stock items.

    ***

    Any help would be appreciated, thanks in advance!

  2. #1272
    Join Date
    Apr 2006
    Posts
    178
    Plugin Contributions
    0

    Default Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+

    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.

  3. #1273
    Join Date
    Jun 2011
    Location
    California
    Posts
    63
    Plugin Contributions
    0

    Default Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+

    Quote Originally Posted by CheekyCockney View Post
    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.
    Turn off the paypal button from your shopping cart page and only have in on the checkout page. Also mod the script as in the tip i posted

  4. #1274
    Join Date
    Apr 2006
    Posts
    178
    Plugin Contributions
    0

    Default Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+

    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.

  5. #1275
    Join Date
    Apr 2006
    Posts
    178
    Plugin Contributions
    0

    Default Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+

    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.

  6. #1276
    Join Date
    Apr 2006
    Posts
    178
    Plugin Contributions
    0

    Default Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+

    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?

  7. #1277
    Join Date
    Apr 2006
    Posts
    178
    Plugin Contributions
    0

    Default Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+

    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?

  8. #1278
    Join Date
    Feb 2008
    Posts
    529
    Plugin Contributions
    0

    Default Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+

    CheekyCockney wrote:

    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.
    Not sure what version you're using. I use 1.4.9 Ajax with no troubles.

    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.

  9. #1279
    Join Date
    Apr 2006
    Posts
    178
    Plugin Contributions
    0

    Default Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+

    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.

  10. #1280
    Join Date
    Jun 2011
    Location
    California
    Posts
    63
    Plugin Contributions
    0

    Default Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+

    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.

    Code:
    //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
    It works fine on my test store that has no mods. On my live
    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/

 

 

Similar Threads

  1. Problems with addon: Dynamic Drop Downs for Stock By Attribute
    By Dunk in forum All Other Contributions/Addons
    Replies: 56
    Last Post: 30 Apr 2014, 07:55 PM
  2. MySQL Problem with Product with Attribute Stock addon
    By rtwingfield in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 20 Sep 2011, 03:35 PM
  3. Hide Zero Quantity Attributes with attribute-stock addon
    By leevil123 in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 11 Feb 2010, 05:06 PM
  4. Replies: 4
    Last Post: 22 Jan 2010, 10:43 PM
  5. Price Products in the grid by 'Stock by Attribute' addon?
    By Salixia in forum Setting Up Categories, Products, Attributes
    Replies: 0
    Last Post: 27 Oct 2009, 06:03 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR