Jump to content

Edit History

mopi

mopi

Bonjour  ;) 

Ca ressemble vraiment a un bug ! 

Avez vous testé les paramètres passer au hook hookDisplayBeforeCarrier($param) ? 

Moi j'ai ca, Sur une base PrestaShop 1.7.7  fraichement installer en local, sans thème particulier et sous PHP 7.14

array:3 [▼
  "cart" => Cart {#120 ▶}
  "cookie" => Cookie {#18 ▶}
  "altern" => 1
]

 

  Suivant la doc PrestaShop 1.7.7.0,  et historiquement, devrais  correspondre a ca : 

<?php
array(
    'carriers' => array(
        array(
            'name' => (string) Name,
            'img' => (string) Image URL,
            'delay' => (string) Delay text,
            'price' =>  (float) Total price with tax,
            'price_tax_exc' => (float) Total price without tax,
            'id_carrier' => (int) intified option delivery identifier,
            'id_module' => (int) Module ID
    )),
    'checked' => (int) intified selected carriers,
    'delivery_option_list' => array(array(
        0 => array( // First address
            '12,' => array( // First delivery option available for this address
                 carrier_list => array(
                     12 => array( // First carrier for this option
                         'instance' => Carrier Object,
                         'logo' => <url to the carrier's logo>,
                         'price_with_tax' => 12.4, // Example
                         'price_without_tax' => 12.4, // Example
                         'package_list' => array(
                             1, // Example
                             3, // Example
                          ),
                     ),
                 ),
                 is_best_grade => true, // Does this option have the biggest grade (quick shipping) for this shipping address
                 is_best_price => true, // Does this option have the lower price for this shipping address
                 unique_carrier => true, // Does this option use a unique carrier
                 total_price_with_tax => 12.5,
                 total_price_without_tax => 12.5,
                 position => 5, // Average of the carrier position
             ),
         ),
     )),
     'delivery_option' => array(
         '<id_address>' => Delivery option,
         ...
     )
);


 

ce qui me pose un sacret problème ! 

j'ai chercher sur google un moment , tester plusieurs chose, réinstaller une version de Prestashop.

j'avoue ne pas comprendre . Est-ce un bug ?

 

 

 

 

mopi

mopi

Hello ;) 

JE ne me suis pas rendus compte que c'était en Français ici , désoler . 

Donc, j'ai une incohérence très embêtante  entre la doc PrestaShop 1.7.7 et ce que je vois dans mon code

Sur une base prestashop 1.7.7  fraichement installer en local, sans thème particulier et sous PHP 7.14  j'ai créer un module qui utilise le hook hookDisplayBeforeCarrier

dans ma fonction hookDisplayBeforeCarrier($param) j'ai verifier le contenus de $param qui suivant la doc prestashop devrais correspondre a ca

<?php
array(
    'carriers' => array(
        array(
            'name' => (string) Name,
            'img' => (string) Image URL,
            'delay' => (string) Delay text,
            'price' =>  (float) Total price with tax,
            'price_tax_exc' => (float) Total price without tax,
            'id_carrier' => (int) intified option delivery identifier,
            'id_module' => (int) Module ID
    )),
    'checked' => (int) intified selected carriers,
    'delivery_option_list' => array(array(
        0 => array( // First address
            '12,' => array( // First delivery option available for this address
                 carrier_list => array(
                     12 => array( // First carrier for this option
                         'instance' => Carrier Object,
                         'logo' => <url to the carrier's logo>,
                         'price_with_tax' => 12.4, // Example
                         'price_without_tax' => 12.4, // Example
                         'package_list' => array(
                             1, // Example
                             3, // Example
                          ),
                     ),
                 ),
                 is_best_grade => true, // Does this option have the biggest grade (quick shipping) for this shipping address
                 is_best_price => true, // Does this option have the lower price for this shipping address
                 unique_carrier => true, // Does this option use a unique carrier
                 total_price_with_tax => 12.5,
                 total_price_without_tax => 12.5,
                 position => 5, // Average of the carrier position
             ),
         ),
     )),
     'delivery_option' => array(
         '<id_address>' => Delivery option,
         ...
     )
);

 

or j'ai ca

array:3 [▼
  "cart" => Cart {#120 ▶}
  "cookie" => Cookie {#18 ▶}
  "altern" => 1
]

 

ce qui me pose un sacret problème ! 

j'ai chercher sur google un moment , tester plusieurs chose, réinstaller une version de Prestashop.

j'avoue ne pas comprendre . Est-ce un bug ?

 

 

 

 

mopi

mopi

Hello ;) 

I am in PrestaShop 1.7.7 . just install nothing more . 

P1.14  + apache  2.4.24. 

with my module I use the hook:

hookDisplayBeforeCarrier($param){

dump ($ param)

 when I dump ($ param) I get an array:

array: 3 [▼ "cart" => Cart {# 120 ▶} "cookie" => Cookie {# 18 ▶} "altern" => 1 ] ?? 

But if I look at the prestashop doc, (http://doc.prestashop.com/pages/viewpage.action?pageId=58294522)

the variables should be very different! I certainly did not understand something, do you have a clue?

×
×
  • Create New...