Jump to content

Display All Specific price according to quantity Product-list


Keyosh

Recommended Posts

Hello everyone !!

I am currently trying to show the specific price of each product based on quantities (sold per unit / 3 /5/10 / etc )
I tried to adapt a little code ( product.php and product- list.tpl ) proposed by Nemo on his website:

 http://blog.belvg.com/how-to-display-special-prices-according-to-quantity-at-the-product-list-category-in-prestashop.html

 

The problem is that I get a 1 specific price only (probably related to $ product.quantity_discounts [0]) Can you help me to realize a loop that retrieves each of the quantities and prices specific to display please? My table Smarty Debug I get:

 

 

->scope = "file:./product-list.tpl" $product Smarty_Variable Object (6)
->value = Array (85)
  id_product => "44"
  id_supplier => "0"
  id_manufacturer => "0"
  id_category_default => "440"
  id_shop_default => "1"
  id_tax_rules_group => "1"
  on_sale => "0"
  online_only => "0"
  ean13 => ""
  upc => ""
  ecotax => "0.000000"
  quantity => 0
  minimal_quantity => "1"
  price => 12
  wholesale_price => "0.000000"
  unity => ""
  unit_price_ratio => "0.000000"
  additional_shipping_cost => "0.00"
  reference => "HUM-MANSAPHFEM"
  supplier_reference => ""
  location => ""
  width => "0.000000"
  height => "0.000000"
  depth => "0.000000"
  weight => "0.000000"
  out_of_stock => "2"
  quantity_discount => "0"
  customizable => "0"
  uploadable_files => "0"
  text_fields => "0"
  active => "1"
  redirect_type => "404"
  id_product_redirected => "0"
  available_for_order => "1"
  available_date => "0000-00-00"
  condition => "new"
  show_price => "1"
  indexed => "1"
  visibility => "both"
  cache_is_pack => "0"
  cache_has_attachments => "0"
  is_virtual => "0"
  cache_default_attribute => "0"
  date_add => "2016-06-09 11:58:44"
  date_upd => "2016-06-12 23:23:47"
  advanced_stock_management => "1"
  pack_stock_type => "3"
  id_shop => "1"
  id_product_attribute => "0"
  product_attribute_minimal_quantity => null
  description => ""
  description_short => ""
  available_now => ""
  available_later => ""
  link_rewrite => "mango"
  meta_description => ""
  meta_keywords => ""
  meta_title => ""
  name => "Mango "
  id_image => "fr-default"
  legend => null
  manufacturer_name => null
  category_default => "à collectionner"
  new => "1"
  orderprice => "10.000000"
  allow_oosp => 1
  category => "-a-collectionner"
  link => "http://multin."
  attribute_price => 0
  price_tax_exc => 10
  price_without_reduction => 12
  reduction => 0
  specific_prices => false
  quantity_all_versions => 0
  features => Array (0)
  attachments => Array (0)
  virtual => 0
  pack => 0
  packItems => Array (0)
  nopackprice => 0
  customization_required => false
  rate => 20
  tax_name => "TVA FR 20%"
  quantity_discounts => Array (2)
    0 => Array (19)
      id_specific_price => "4"
      id_specific_price_rule => "0"
      id_cart => "0"
      id_product => "44"
      id_shop => "0"
      id_shop_group => "0"
      id_currency => "0"
      id_country => "0"
      id_group => "0"
      id_customer => "0"
      id_product_attribute => "0"
      price => "-1.000000"
      from_quantity => "3"
      reduction => "2.000000"
      reduction_tax => "1"
      reduction_type => "amount"
      from => "0000-00-00 00:00:00"
      to => "0000-00-00 00:00:00"
      score => "14"
    1 => Array (19)
      id_specific_price => "5"
      id_specific_price_rule => "0"
      id_cart => "0"
      id_product => "44"
      id_shop => "0"
      id_shop_group => "0"
      id_currency => "0"
      id_country => "0"
      id_group => "0"
      id_customer => "0"
      id_product_attribute => "0"
      price => "-1.000000"
      from_quantity => "5"
      reduction => "3.000000"
      reduction_tax => "1"
      reduction_type => "amount"
      from => "0000-00-00 00:00:00"
      to => "0000-00-00 00:00:00"
      score => "14"
  color_list => ""
->nocache = false
->scope = "file:./product-list.tpl"
->_loop = true
->total = 1
->key = 0

 

I don't know if it is with this that I have to play but it is certain that I 'm not good enough level syntax to get out every time .. Thank you to those who take the time to answer me , and thank you to those who would have liked but as lost as me! : D

 

(& Sorry about my english).

 

Bye !

I do not show you mine is under construction and as much again on a good foundation. : D The problem is that I do not get a single specific price (probably related to $ product.quantity_discounts [0]) Can you aiguillez me to realize a loop that retrieves each of the quantities and prices specific to display ? My table Smarty Debug I get:

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...