Jump to content
thirty bees forum

SLiCK_303

Trusted Members
  • Posts

    1,202
  • Joined

  • Last visited

  • Days Won

    18

Everything posted by SLiCK_303

  1. How about this one, it only changes two lines from the original 1.0.x file ``` protected function updateCustomizationQuantity($quantityChange, $idCustomization, $idProduct, $idProductAttribute, $idAddressDelivery, $operator = 'up') { // Link customization to product combination when it is first added to cart if (empty($idCustomization) && $operator === 'up') { $customization = $this->getProductCustomization($idProduct, null, true); foreach ($customization as $field) { if ((int) $field['quantity'] === 0) { Db::getInstance()->update( 'customization', [ 'quantity' => (int) $quantityChange, 'idproduct' => (int) $idProduct, 'idproductattribute' => (int) $idProductAttribute, 'idaddressdelivery' => (int) $idAddressDelivery, 'incart' => true, ], 'id_customization = '.(int) $field['idcustomization'] ); } } } /* Quantity update */ if (!empty($idCustomization)) { $result = (int) Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue( (new DbQuery()) ->select('`quantity`') ->from('customization') ->where('`id_customization` = '.(int) $idCustomization) ); if ($operator === 'down' && ((int) $result - (int) $quantityChange) < 1) { return Db::getInstance()->delete('customization', '`id_customization` = '.(int) $idCustomization); } return Db::getInstance()->update( 'customization', [ 'quantity' => ['type' => 'sql', 'value' => '`quantity` '.($operator === 'up' ? '+' : '-').(int) $quantityChange], 'id_address_delivery' => (int) $idAddressDelivery, 'in_cart' => true, ], '`id_customization` = '.(int) $idCustomization ); } // refresh cache of static::_products $this->_products = $this->getProducts(true); $this->update(); return true; } ```
  2. It seems like it works for me, I dont understand I guess what you're saying. I can add, and delete items in the cart with no issue. If this fix isn't the correct solution, at least we know the function causing the issue, and you can fix it. I made a video about it, but cant seem to share it here anymore. ;( Maybe this will work.. https://vimeo.com/250966125
  3. This seems to have fixed it for me, give it a try... Replace the function in /classes/Cart.php, protected function updateCustomizationQuantity, with the following code.. ``` protected function _updateCustomizationQuantity($quantityChange, $idCustomization, $idProduct, $idProductAttribute, $idAddressDelivery, $operator = 'up') { // Link customization to product combination when it is first added to cart if (empty($idCustomization)) { $customization = $this->getProductCustomization($idProduct, null, true); foreach ($customization as $field) { if ($field['quantity'] == 0) { Db::getInstance()->execute(' UPDATE '._DB_PREFIX_.'customization SET quantity = '.(int) $quantityChange.', id_product_attribute = '.(int) $idProductAttribute.', id_address_delivery = '.(int) $idAddressDelivery.', in_cart = 1 WHERE id_customization = '.(int) $field['idcustomization']); } } } /* Deletion */ if (!empty($idCustomization) && (int) $quantityChange < 1) { return $this->_deleteCustomization((int) $idCustomization, (int) $idProduct, (int) $idProductAttribute); } /* Quantity update */ if (!empty($idCustomization)) { $result = Db::getInstance()->getRow('SELECT `quantity` FROM `'._DB_PREFIX_.'customization` WHERE `id_customization` = '.(int) $idCustomization); if ($result && Db::getInstance()->NumRows()) { if ($operator == 'down' && (int)$result['quantity'] - (int) $quantityChange < 1) { return Db::getInstance()->execute('DELETE FROM `'._DB_PREFIX_.'customization` WHERE `id_customization` = '.(int) $idCustomization); } return Db::getInstance()->execute(' UPDATE `'._DB_PREFIX_.'customization` SET `quantity` = `quantity` '.($operator == 'up' ? '+ ' : '- ').(int) $quantityChange.', `id_address_delivery` = '.(int) $idAddressDelivery.', `in_cart` = 1 WHERE `id_customization` = '.(int) $idCustomization); } else { Db::getInstance()->execute(' UPDATE `'._DB_PREFIX_.'customization` SET `id_address_delivery` = '.(int) $idAddressDelivery.', `in_cart` = 1 WHERE `id_customization` = '.(int) $idCustomization); } } // refresh cache of static::_products $this->_products = $this->getProducts(true); $this->update(); return true; } ``` if this works for everyone, I'll make a pull request for it..
  4. I'm getting close, the problem seems to be in the function _updateCustomizationQuantity...
  5. The problem lies in classes/Cart.php, when I take the one from ps1.6.1.17 it works fine. So...more looking into it.
  6. I have confirmed your issue. Lets hope they can find a solution for it soon. As a matter of fact I found another error on doing so. When I try to decrease the number of items, I get this...
  7. sure...stand by
  8. I dont see that problem in 1.0.x, so I assume it's been fixed.
  9. @smarterweb , I did a pull request on this earlier, and it was accepted. So your wish was granted, nice contrib.
  10. ill do it later today, im just up to let the dogs out right now.
  11. np..I try to help... Want me to do this one?
  12. Maybe you just havent gotten around to the new pull requests yet... ;) https://github.com/thirtybees/thirtybees/pull/428
  13. i hear ya, thats all I'm trying to do as well.
  14. I would fix it and do the pull request for this issue myself, but mine seem to get dismissed. ;(
  15. im just a user here....so........
  16. I think most bugs go on the forums first to be talked about, then if they are really a bug go on github...
  17. If you have confirmed the problem and the fix on tb's, you might wanna post this on gitub, https://github.com/thirtybees/thirtybees/issues
  18. @lathaneo said in Adding a ‘sort by sales’ option: {if $page_name == 'category'} <option value="sales:desc"{if $orderby eq 'sales' AND $orderway eq 'desc'} selected="selected"{/if}>{l s='Best Sales'}</option> {/if} Thanks for that, I didn't think of doing it..
  19. Is there modification to each of those functions one can do to make the sort work, or is it not feasible?
  20. @Nemo, I have an issue with this, and that is, in best-sales, new-products, and prices-drop, the sort by sales does not work. When viewing any category it works fine, but in those 'special' pages, it just doesn't work. You can see this at my website. Any thoughts?
  21. go out of modules and services, and then back in, it should show v6.0.0
  22. @30knees , I used to have that same problem on occasion with 5.3.2. Since switching to 6.0.0 beta 4 I have not had that problem again. You might wanna try the newer version.
  23. Im just saying you might wanna try it, if your having issues with 5.3.2. As long as your different sites all use different API settings.
  24. Check out this thread of mine..https://forum.thirtybees.com/topic/1256/paypal-issue/4. I've had good luck with beta 4 since I figured out not to have two sites running the same paypal API settings. I have not had any problems with what you are talking about since changing to beta4.
  25. you can try manually d/l and installing an older version of it via github...
×
×
  • Create New...