Jump to content

nosnevetzy

Members
  • Posts

    46
  • Joined

  • Last visited

1 Follower

Profile Information

  • First Name
    Yztevenson
  • Last Name
    Bier

nosnevetzy's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Hello. I'm having an issue about the id_cart on the Cookie/Context object. I have a custom payment module that needs to access the Cookie/Context object from Prestashop in order to validate the order. Below is when I print the cookie object after purchasing an item on the shop that I'm working on. You can see that the id_cart is missing. This is also happening only when the customer already visited/purchased an order to the shop. If the shop was visited for the first time, the id_cart is in the object, but when you try to purchase an order again, the id_cart is missing. I already cleared the cache from the adminpanel and even in the FTP files and I also disable it for a while to test if its the cache that causing the problem but I still facing the issue. Note that since this is a payment module, the order wasn't created yet so the cookie/context object is the only reference to get the cart_id. Below is the sample code in my custom payment module that calls the global cookie object and get the id_cart. It was the first time I encountered this issue. Everything is working fine before. Please share your insights on this issue. It would be a big help for me. Thanks!
  2. Is there anyone who can help me on this? The documentation is not clear about this webpack.
  3. Glad that I could help. It's good that you think to change the default value. Hehe.
  4. Is there anyone who can help me on this? Please. If we can use the featured products module on the homepage to display the combinations and add to cart button, can you please tell how? Any insights? Thanks!
  5. Try to go to Preferences > Products > Separator of attribute anchor on the product links > Select "-".
  6. Hello everyone. I was trying to list my products on the homepage with all of its combinations, quantity and add to cart button shown on the homepage just like the product page. Can this be possible? How? Please help. I'm using the featured products module on the homepage. Can this be customized and make it like a product page? Thanks!
  7. Hello guys. I'm currently building my project on 1.7.1.x and I'm using Starter theme as my current theme. I just want to ask how should I edit my assets with Webpack. How should I edit the existing js and css code? Please help. Thanks!
  8. Did you already clear your browsing history and your browser's cache?
  9. I had the same problem and I solved it by creating the template file to <your-site>/themes/default-bootstrap(or the name of your current theme)/modules/<name of the module> and then from your MyModuleAllProductsModuleFrontController, replace $this->setTemplate(_PS_THEME_DIR_ . 'all-products.tpl'); to $this->setTemplate('all-products.tpl');
  10. Hello everyone! Please help me on how to display price in wishlist module when I click the wishlist that sent to me by a friend. Help me please. Thanks in advance!
  11. Hello Divyesh! I already solved my problem. I forgot to include 'combinations' => $combinations, in $this->context->smarty->assign(array( 'category' => $this->category, 'description_short' => Tools::truncateString($this->category->description, 350), 'products' => $products, 'id_category' => (int)$this->category->id, 'id_category_parent' => (int)$this->category->id_parent, 'return_category_name' => Tools::safeOutput($this->category->name), 'path' => Tools::getPath($this->category->id), 'add_prod_display' => Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'), 'categorySize' => Image::getSize(ImageType::getFormatedName('category')), 'mediumSize' => Image::getSize(ImageType::getFormatedName('medium')), 'thumbSceneSize' => Image::getSize(ImageType::getFormatedName('m_scene')), 'homeSize' => Image::getSize(ImageType::getFormatedName('home')), 'allow_oosp' => (int)Configuration::get('PS_ORDER_OUT_OF_STOCK'), 'comparator_max_item' => (int)Configuration::get('PS_COMPARATOR_MAX_ITEM'), 'suppliers' => Supplier::getSuppliers(), 'body_classes' => array($this->php_self.'-'.$this->category->id, $this->php_self.'-'.$this->category->link_rewrite) )); But now, I have another problem. When I choose an attribute, and then hit the add to cart button, the cart display the DEFAULT ATTRIBUTE VALUE and NOT THE ONE THE I SELECTED. So please, help me. in my site, I disable the quick view animation. I also hook the blockcart on my right column hook. Do you have any idea why? Thanks a lot Divyesh!
  12. Hello there! I tried Vieka's solution and it's works, I made the attributes like a drop down menu so the customer can choose what's attribute they want to order,however, after hitting the "Add to cart" button, it didn't display the attribute I've chose. It displays the default attribute and not what I've chosen. Please help!
  13. Divyesh Prajapati, Thank you for the quick response! Please help me. By the way, I'm using Prestashop 1.6.14. Thanks in advance! Please help.
  14. As what you've said, I placed this code below in my classes/Product.php public static function getProductAttributeCombinations($id_product) { $combinations = array(); $context = Context::getContext(); $product = new Product ($id_product, $context->language->id); $attributes_groups = $product->getAttributesGroups($context->language->id); $att_grps = ''; foreach ($attributes_groups as $k => $row) { $combinations[$row['id_product_attribute']]['attributes_values'][$row['id_attribute_group']] = $row['attribute_name']; $combinations[$row['id_product_attribute']]['attributes_group'][$row['id_attribute_group']] = $row['group_name']; $combinations[$row['id_product_attribute']]['attributes_groups'] = @implode(', ', $combinations[$row['id_product_attribute']]['attributes_group']); $att_grps = $combinations[$row['id_product_attribute']]['attributes_groups']; $combinations[$row['id_product_attribute']]['attributes_names'] = @implode(', ', $combinations[$row['id_product_attribute']]['attributes_values']); $combinations[$row['id_product_attribute']]['attributes'][] = (int)$row['id_attribute']; $combinations[$row['id_product_attribute']]['price'] = (float)$row['price']; // Call getPriceStatic in order to set $combination_specific_price if (!isset($combination_prices_set[(int)$row['id_product_attribute']])) { Product::getPriceStatic((int)$product->id, false, $row['id_product_attribute'], 6, null, false, true, 1, false, null, null, null, $combination_specific_price); $combination_prices_set[(int)$row['id_product_attribute']] = true; $combinations[$row['id_product_attribute']]['specific_price'] = $combination_specific_price; } $combinations[$row['id_product_attribute']]['ecotax'] = (float)$row['ecotax']; $combinations[$row['id_product_attribute']]['weight'] = (float)$row['weight']; $combinations[$row['id_product_attribute']]['quantity'] = (int)$row['quantity']; $combinations[$row['id_product_attribute']]['reference'] = $row['reference']; $combinations[$row['id_product_attribute']]['unit_impact'] = $row['unit_price_impact']; $combinations[$row['id_product_attribute']]['minimal_quantity'] = $row['minimal_quantity']; if ($row['available_date'] != '0000-00-00') { $combinations[$row['id_product_attribute']]['available_date'] = $row['available_date']; $combinations[$row['id_product_attribute']]['date_formatted'] = Tools::displayDate($row['available_date']); } else $combinations[$row['id_product_attribute']]['available_date'] = ''; foreach ($combinations as $id_product_attribute => $comb) { $attribute_list = ''; foreach ($comb['attributes'] as $id_attribute) $attribute_list .= '\''.(int)$id_attribute.'\','; $attribute_list = rtrim($attribute_list, ','); $combinations[$id_product_attribute]['list'] = $attribute_list; } } $comb = array( 'attribute_groups' => $att_grps, 'values' => $combinations ); return $comb; } And then, after that, I placed this code below on CategoryController.php, ManufacturerController.php, NewProductsController.php,PriceDropController.php, and BestSalesController.php under initContent() function $products = (isset($this->cat_products) && $this->cat_products) ? $this->cat_products : null; foreach($products as &$pro) { $pro['combinations'] = Product::getProductAttributeCombinations($pro['id_product']); } And then, I replaced product-list.tpl, global.js, ajax-cart.js with your files attached on your first post. And I also added this code to my global.css .att_list{padding:10px;} .att_list .selector{margin: 0 auto;} And then, after that, I refreshed the page and still nothing attributes displayed in my product list. Please help!!!
×
×
  • Create New...