Jump to content

PS 1.6 is product gift ?


Rissinko

Recommended Posts

Hi,i am working on summary page for bankwire module in my shop and i have problem to check if product is gift ... is anyone know which class is used in shopping-cart-product-line.tpl for storing this information ? or how can i get this info in bankwire module ??

 

 

in  shopping-cart-product-line.tpl it is stored in $product.gift but class cart do not contain 'gift' in information about product.

 

Link to comment
Share on other sites

Here is the picture of the code and print_r of the $product from shopping-cart-product-line.tpl

 

2HdEdZP.jpg

 

gift is as last info in array...

Array ( [id_product_attribute] => 0 [id_product] => 691 [cart_quantity] => 1 [id_shop] => 1 [name] => Reklamné pero [is_virtual] => 0 [description_short] => Reklamné pero Tvojakáva. Darček k objednávke. 
[available_now] => [available_later] => ZASIELAME IHNEĎ [id_category_default] => 180 [id_supplier] => 0 [id_manufacturer] => 0 [on_sale] => 0 
[ecotax] => 0.000000 [additional_shipping_cost] => 0.00 [available_for_order] => 1 [price] => 0 [active] => 1 [unity] => 
[unit_price_ratio] => 0.000000 [quantity_available] => -165 [width] => 0.000000 [height] => 0.000000 [depth] => 0.000000 [out_of_stock] => 2 
[weight] => 0.000000 [date_add] => 2017-04-21 13:27:45 [date_upd] => 2017-07-24 13:00:06 [quantity] => 1 [link_rewrite] => reklamne-pero 
[category] => darceky [unique_id] => 00000006910000000000778 [id_address_delivery] => 778 [advanced_stock_management] => 0 [supplier_reference] => 
[customization_quantity] => [id_customization] => [reference] => [ean13] => [upc] => [minimal_quantity] => 1 [wholesale_price] => 0.000000 
[id_image] => 6[spam-filter]1133 [legend] => Reklamné pero [reduction_type] => 0 [stock_quantity] => -165 [price_without_reduction] => 0.5 
[price_with_reduction] => 0.5 [price_with_reduction_without_tax] => 0.416667 [total] => 0 [total_wt] => 0 [price_wt] => 0 
[reduction_applies] => [quantity_discount_applies] => [allow_oosp] => 1 [features] => Array ( ) [rate] => 20 [tax_name] => DPH SK 20% 
[price_without_quantity_discount] => 0.5 [reduction_formatted] => 0,00 € [gift] => 1 )
Edited by Rissinko (see edit history)
Link to comment
Share on other sites

I still don't know where in products page this flag is set. but anyway... try

 

{if $product.gift == 1}

 

Why: the array might be always set - with 0 or 1.

If unsure, just output the value into your tpl and you will set if its set and how it is set if it is not set.

Edited by Scully (see edit history)
Link to comment
Share on other sites

Maybe i didn't write it right so i try it again..

 

 

I am working on summary page in bankwire module.
I know that in shopping-cart-product-line.tpl there is variable $product.gift
And i need to know from what class i get it or how i can get it on my custom page because class Cart.php and function getproducts do not contain this info in array.
maybe it is from class Product but i somehow can't get info from this class in module...
Link to comment
Share on other sites

So i tried to load object and print_r array but no gift info there...

      public static function getProductInfo($product_id) {
                
                $product = new Product ($product_id, $lang->id);
                print_r($product);
        
      }

So anyone who knows where is this gift info stored or which class creating/using it ? 

 

Thanks :)

Link to comment
Share on other sites

You have never answered my first question. Where is this gift flag from within products?

Result - I'm out with helping.

 

My product tables do not have a gift field at all - hence also no such a flag in the products object.

Link to comment
Share on other sites

This flag is in shopping-cart-product-line.tpl it shows when the product is added from cart rule like gift to the order....I really like to give you these informations but i don't know :D this is why i am looking for help because i can't find anything about it here and in prestashop codes/tables also.

Edited by Rissinko (see edit history)
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...