girl Posted December 14, 2007 Posted December 14, 2007 Hi, Can some one help me. After upteem hours I have discovered that my stock number does not reduce when I have a downlaodable product, BUT reduces when the product is not downloadble. WHY??? And does any one know how to fix it, so the stock quantity will reduce with downaloadble also. The product I wish to sell is in limited quantities so it is important that I get this fixed. Thanks in advance
germ Posted December 14, 2007 Posted December 14, 2007 I was looking at the code in checkout_process.php It looks as if it's purposely coded to NOT reduce stock if it's a download. Which makes sense in most cases since a "download" isn't normally a "limited" item since after you download it, it's still there. Anyway, in checkout_process.php find this code: // do not decrement quantities if products_attributes_filename exists if ((DOWNLOAD_ENABLED != 'true') || (!$stock_values['products_attributes_filename'])) { $stock_left = $stock_values['products_quantity'] - $order->products[$i]['qty']; } else { $stock_left = $stock_values['products_quantity']; } Change it to this: // do not decrement quantities if products_attributes_filename exists if ((DOWNLOAD_ENABLED != 'true') || (!$stock_values['products_attributes_filename'])) { $stock_left = $stock_values['products_quantity'] - $order->products[$i]['qty']; } else { $stock_left = $stock_values['products_quantity'] - $order->products[$i]['qty']; // changed 14-DEC-07 } I think that will work to do what you want. You'll need to check because I've never "fixed" this problem before. I'm just making an educated guess based on my interpretation of the code and my coding experience (30+ years). :blush: If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you. "Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice." - Me - "Headers already sent" - The definitive help "Cannot redeclare ..." - How to find/fix it SSL Implementation Help Like this post? "Like" it again over there >
girl Posted December 14, 2007 Author Posted December 14, 2007 With my 10 days website thingy experience I must say you are absolutely wonderful. It works like a charm. Thank you. :lol:
germ Posted December 14, 2007 Posted December 14, 2007 :sweating: :lol: You're most welcome, Ma'am. :rolleyes: If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you. "Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice." - Me - "Headers already sent" - The definitive help "Cannot redeclare ..." - How to find/fix it SSL Implementation Help Like this post? "Like" it again over there >
germ Posted December 14, 2007 Posted December 14, 2007 :blush: Thank you, Miss Anthony. If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you. "Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice." - Me - "Headers already sent" - The definitive help "Cannot redeclare ..." - How to find/fix it SSL Implementation Help Like this post? "Like" it again over there >
Recommended Posts
Archived
This topic is now archived and is closed to further replies.