Jump to content

3cubes

Members
  • Posts

    45
  • Joined

  • Last visited

1 Follower

Profile Information

  • Location
    Germany
  • Activity
    User/Merchant

Recent Profile Visitors

4,478,163 profile views

3cubes's Achievements

Newbie

Newbie (1/14)

3

Reputation

1

Community Answers

  1. Hallo Silbersaiten, das wäre sehr wünschenswert. Wir betreiben gerade ebenfalls 2 Shops auf Basis der Versionen 1.5.4.1 und 1.5.6.2 (beide mit Germanext) und würden es wirklich sehr hilfreich finden, anhand einer Art Checkliste zu erfahren, was wir alles ändern müssen, damit wir ab dem 13.06. nicht zur Freiwild erklärt werden :-) Daher werdeen wir diesen Thread sicherlich noch genauer beobachten in den nächsten Tagen. Vielen Dank schon im voraus für all die Mühen Eurerseits. Echt super Arbeit, die Ihr leistet. Beste Grüße
  2. Just change lines 63-66 to this: <div class="content_price"> {if isset($product.show_price) && $product.show_price && !isset($restricted_country_mode)}<span class="price" style="display: inline;">{if $product.id_product_attribute}{l s='From'}{/if}{if !$priceDisplay}{convertPrice price=$product.price}{else}{convertPrice price=$product.price_tax_exc}{/if}</span><br />{/if} {if isset($product.available_for_order) && $product.available_for_order && !isset($restricted_country_mode)}<span class="availability">{if ($product.allow_oosp || $product.quantity > 0)}{l s='Available'}{elseif (isset($product.quantity_all_versions) && $product.quantity_all_versions > 0)}{l s='Product available with different options'}{else}{l s='Out of stock'}{/if}</span>{/if} </div>
  3. Better solution would be to add this code to prevent from showing "from" when product has no attributes as it makes no sense to show it if product has only one fixed price: {if $product.id_product_attribute} <h5>{l s='From'}</h5> {/if} just my 2cents
  4. You have to customize ajax-cart.js file in .../modules/blockcart/ and tell him to send your custom form data along with standard data when add to cart button is pressed.
  5. I had same issue with firefox after moving from local installation to live server. Every single cart I created in the shop was empty when I clicked to view cart on shopping-cart-page or to checkout. After looking into the database I also recognized that prestashop was creating a complete new cart with a new id for each single product everytime you added a product into cart. But strange thing was that it only happened in firefox. Chrome and IE had no issues like this. I think it has something to do with some strange cookie and token issues in certain browsers. So just delete all cookies and the whole cache in your browser. Close browser. Open Browser. And visit your site again. For me it worked. Issue is gone since then and everything works fine. Hope it helps...Goold luck
  6. Still getting crazy on this issue. Try and try and no solution yet. Please someone any hints in the right direction???
  7. Hello friends, I have a technical issue I hope to solve with your help: When you add a product into cart it is done by the CartController and its Cart Class. Within the Cart class there is a method called updateQty. Within this function there is a check if cart already contains product or not. If cart contains product then increase its quantity when operator == up and decrease its quantity when operator == down, else if cart does not contain product then add product to cart when operator == up. This is the certain function mentioned above from Cart.php /* Check if the product is already in the cart */ $result = $this->containsProduct($id_product, $id_product_attribute, (int)$id_customization, (int)$id_address_delivery); /* Update quantity if product already exist */ if ($result) { if ($operator == 'up') { $sql = 'SELECT stock.out_of_stock, IFNULL(stock.quantity, 0) as quantity FROM '._DB_PREFIX_.'product p '.Product::sqlStock('p', $id_product_attribute, true, $shop).' WHERE p.id_product = '.$id_product; $result2 = Db::getInstance()->getRow($sql); $product_qty = (int)$result2['quantity']; // Quantity for product pack if (Pack::isPack($id_product)) $product_qty = Pack::getQuantity($id_product, $id_product_attribute); $new_qty = (int)$result['quantity'] + (int)$quantity; $qty = '+ '.(int)$quantity; if (!Product::isAvailableWhenOutOfStock((int)$result2['out_of_stock'])) if ($new_qty > $product_qty) return false; } else if ($operator == 'down') { $qty = '- '.(int)$quantity; $new_qty = (int)$result['quantity'] - (int)$quantity; if ($new_qty < $minimal_quantity && $minimal_quantity > 1) return -1; } else return false; /* Delete product from cart */ if ($new_qty <= 0) return $this->deleteProduct((int)$id_product, (int)$id_product_attribute, (int)$id_customization); else if ($new_qty < $minimal_quantity) return -1; else Db::getInstance()->execute(' UPDATE `'._DB_PREFIX_.'cart_product` SET `quantity` = `quantity` '.$qty.', `date_add` = NOW() WHERE `id_product` = '.(int)$id_product. (!empty($id_product_attribute) ? ' AND `id_product_attribute` = '.(int)$id_product_attribute : '').' AND `id_cart` = '.(int)$this->id.(Configuration::get('PS_ALLOW_MULTISHIPPING') && $this->isMultiAddressDelivery() ? ' AND `id_address_delivery` = '.(int)$id_address_delivery : '').' LIMIT 1' ); } /* Add product to the cart */ elseif ($operator == 'up') { $sql = 'SELECT stock.out_of_stock, IFNULL(stock.quantity, 0) as quantity FROM '._DB_PREFIX_.'product p '.Product::sqlStock('p', $id_product_attribute, true, $shop).' WHERE p.id_product = '.$id_product; $result2 = Db::getInstance()->getRow($sql); // Quantity for product pack if (Pack::isPack($id_product)) $result2['quantity'] = Pack::getQuantity($id_product, $id_product_attribute); if (!Product::isAvailableWhenOutOfStock((int)$result2['out_of_stock'])) if ((int)$quantity > $result2['quantity']) return false; if ((int)$quantity < $minimal_quantity) return -1; $result_add = Db::getInstance()->insert('cart_product', array( 'id_product' => (int)$id_product, 'id_product_attribute' => (int)$id_product_attribute, 'id_cart' => (int)$this->id, 'id_address_delivery' => (int)$id_address_delivery, 'id_shop' => $shop->id, 'quantity' => (int)$quantity, 'date_add' => date('Y-m-d H:i:s'), 'customprice' => (float)$customprice, )); if (!$result_add) return false; } This is cart's logical behaviour because if you already have a product in the cart and lets say you press again add-to-cart button for same product, it has same result as if you would press the plus-button in cart for increasing product quantity. It would be bad behaviour if pretashop would add same product to cart twice. Everything is fine so far if you use Prestashop the regular way when every of your products has a fix price set in backoffice. But in may case customer can add product to cart with a custom price. So now when you add product into cart with a custom price and you go back to product page and add same product but with a different custom price then of course cart acting like this: It only increases the quantity of the first product you already added to cart because this product already exists in cart. The second custom price is beeing ignored. Somebody has any idea in which file I have to change things to tell the cart controller that when same product is added to cart BUT with different price it should not increase the quantity of the first item instead controller should add the product again into cart like it would be a different product!!??? Any help is appreciated Best regards P.S. I am using Prestashop Version 1.5.6.2
  8. Hi Pascal, thank you for your time you are investing to helping me out. I really appreciate it. But I really think that we are on the wrong path. So let me please explain my situation a little more specific for a better understanding: When customer is on my product page he has the opportunity to "customize" the product wih the help of a configuration wizard I have built with javascript/jquery. At the end of this process customer can add customized product to cart which now has a custom price and a custom "ordertext" for me as the shop-owner to get alle the customization information When clicking on add-to-cart-button product is added to cart with new customprice and customtext I fetch these custom datas in cart.php during the add-to-cart process and insert them to ps_cart_product table as every product in the cart can theoritically have a customprice and a customtext So now that these custom values are saved in the database correctly I would like to intergrate them through the rest of the order process like in the blockcart, in cart summary, in orders (backoffice), invoices and so on... My customprice is working fine through the whole process as it is recalculated by an override of the priceStatic function...I am just stucked on this issue with my customtext. I dont get it assigned to show in cart and orders and invoices. I hope this was clear enough for a better understanding. I really would appreciate any further assistance to get this challenge done. Best regards
  9. Hi all, is it possible to create a new product for every customization is added to cart? Right now prestashop works like this: When you add product to cart with customization then customization is added into a new row in cart display. When you add a further customization for the same product then the product row in cart is the same. There is only a new row added for the new customization. This works like this because every product has a fix price and so every customization is based on the same product with same price. But what if you have different prices for every customization?? Each new customization is based on the same product but with a different price. So it should be possible to create a new (duplication or) instance of the same product but with different price. Anybody some suggestions how to achieve this?
  10. I'm really stucked on this issue. Is there anybody who maybe solved something like this? I mean right now I have everything I need: there is my custom value which I am fetching and it is successfully stored into the database along with the product and the cart it belongs to. So where have I to read and assign this variable to smarty to be able to show it in template files like in blockcart.tpl or shopping-cart-product-line.tpl ???
  11. Hi Pascal, sorry for not providing the essential information. I am using Prestashop Version 1.5.6.2 In Cart.php in public function updateQty() I use this to get value of customtext $customtext = Tools::getValue('customtext'); Then when product is going to be added to cart within the same function there is a sql query to insert all product data in _cart_product table. Here I just insert my variable like this in the database $result_add = Db::getInstance()->insert('cart_product', array( 'id_product' => (int)$id_product, 'id_product_attribute' => (int)$id_product_attribute, 'id_cart' => (int)$this->id, 'id_address_delivery' => (int)$id_address_delivery, 'id_shop' => $shop->id, 'quantity' => (int)$quantity, 'date_add' => date('Y-m-d H:i:s'), 'customtext' => $customtext, )); I just dont know where else to fetch my custom data as it is sent to controller when pressing "add_to_cart" button on product page. So I think here in updateQty() function is best place to fetch that data and insert into table. If you have any better idea I would like to read it
  12. I even tried a sql query within blockcart.php like this: $sql = 'SELECT(`customtext`) FROM `'._DB_PREFIX_.'cart_product` WHERE `id_product` = '.(int)$id_product.' AND `id_product_attribute` = ' . (int)$id_product_attribute . ' AND `id_cart` = '.(int)$id_cart; $customtext = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue($sql); and made the smarty assign with 'customtext' => $customtext Still no value when I echo $customtext on page!??
  13. Hi Pascal, actually I am not doing any sql query within blockcart.php. I just tried to make the echo test - > no value is beeing shown. So I think I have to run a query within blockcart.php?
  14. Hi PascalVG, thank you very much for your reply. I just tried the steps you mentioned but it doesn't work for me somehow!? Maybe I am overseeing something? I just deinstalled my module and put my custom functionality into Cart.php by overriding it. As soon I have things work out I will adapt solutions back into my module. So for now it is working like this: 1. When clicking adding to cart, product is beeing added to cart and along with that a customtext is beeing passed to Cart.php and is fetched there by Tools::getValue('customtext') and assigned to a variable like $customtext. Value is then beeing saved in a custom row I created within ps_cart_product. 2. Now I edit blockcart.php and assign smarty variable: 'customtext' => $customtext like you mentioned above 3. I edit blockcart.tpl and insert {$customtext} somewhere after product title --> Nothing shows up! Would really appreciate any further assistance to get this done work. Thank you very much in advance
  15. Hey Tuk66, thanks for your reply. I already know a solution like your suggestion. But I really would like to get this done without the use of the built-in customization fields. So far I have created a custom module which fetches and saves all my custom data in a custom table in the database once a product is added to cart. My custom table is assigned to product which has been added to cart. So I have the right values for id_cart, id_shop, id_product, id_product_attribute along with my customtext. Everything is now fine in the databse. So I think there must be a simple way to show this customtext in the cart and in the order and in invoices as long as every customtext is always assigned to a single product/cart association!?
×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More