DPD pickup project (for France relays)

  • Posts: 12
  • Thank you received: 0
7 years 5 months ago #271345

-- HikaShop version -- : 2.6.5
-- Joomla version -- : 3.7.2
-- PHP version -- : 7.0
-- Browser(s) name and version -- : firefox 53.0.2
-- Error-message(debug-mod must be tuned on) -- : The order_address_id isn't overrided

Hello Hikashop team,

I' m developping a DPD's pickup plugin based on the custom fields model like modialrelay developped their own.

In my case, at the end of the checkout I test if the address id exists or not.
If this address exists in the address table I set the user address_shipping_ id with the existant id of my DPD's pickup like this :
$app->setUserState(HIKASHOP_COMPONENT.'.shipping_id', $this->addressExist($user_id, $address_type));
if not I insert a new address and set this new "address_shipping_id".
That part of code works well. But when I finish the order, this is not this "address_id" which appear in the order table. My plug in have to override this "address_shipping_id" by the pickup address_id selectedby the user at the checkout.

I need to know which datas with, the insertion is done in hikashop order table.

Is this send by a form with POST ot GET method to the next step ?
How this value is stored while the checkout isn't finalized ?
How could I be able to modifiy this ?

My plugin should be deal this address before the finalization of the order, and not override the shippment_address_id using any trigger afterOrder ...

What I imagine to do is : send the value of the address_shipping_id from method getUserState(HIKASHOP_COMPONENT.'.shipping_id') to the current order. But I don't know how to do, even if it's possible or not.

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
7 years 5 months ago #271372

Hi,

I don't understand what you're doing.
The line:
$app->setUserState(HIKASHOP_COMPONENT.'.shipping_id', $this->addressExist($user_id, $address_type));
will set the value of $this->addressExist($user_id, $address_type) as id of the selected shipping method, and not as id of the selected shipping address.
So if you want to set the selected shipping address, you should replace the "shipping_id" in that code by "shipping_address".
In fact, you already use "shipping_address" to get the shipping address in the onAfterCheckoutStep function in your code, so I don't know if you made a mistake in your code or in what you wrote here.

In HikaShop 2.6.x the checkout takes the data of the cart/checkout and save it in an order in the function "after_confirm" of the file components/com_hikashop/controllers/checkout.php
In your plugin, you can actually use the trigger onBeforeOrderCreate to have access to the $order object just before it is being saved in the database and thus you can change the order_shipping_address_id if you want on the fly at that point.

Please Log in or Create an account to join the conversation.

  • Posts: 12
  • Thank you received: 0
7 years 5 months ago #271494

Hello,

Thank you for your reply. I wanted to know if it is possible to continue our exchange in private, possibly by telephone on the morning of next Monday (19/06/2017), at the time that suits you. In this case, I would give you our phone number by private message. Note that I would be more favorable to an exchange in French if that does not cause you any worries.

Excellent end of day,

Sebastian

Please Log in or Create an account to join the conversation.

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
7 years 5 months ago #271497

Hello,

I'm sorry but it won't be possible to continue using telephone or else.
Support and communication is exclusively via the forum and by email.
Afterwards, French is not a problem for us.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 12
  • Thank you received: 0
7 years 5 months ago #271655

Bonjour,

Merci pour les conseils, j'ai changé la ligne :
$app->setUserState(HIKASHOP_COMPONENT.'.shipping_id', $this->addressExist($user_id, $address_type));
par
$app->setUserState(HIKASHOP_COMPONENT.'.shipping_id', $this->addressExist($user_id, $address_type));
$shipping_address = $app->getUserState(HIKASHOP_COMPONENT.'.shipping_id');

Et je retourne $shipping_address dans la fonction dans laquelle sont ces instructions, que j'utilise ensuite

Et ça fonctionne bien maintenant, j'arrive à insérer les données du point-relais dans les informations de livraison de la commande.
En revanche lorsque je clique sur facture dans le panneau de configuration d'une commande passée en point-relais, l'adresse de livraison ne s'affiche plus.

Note : Cette adresse de livraison n'est plus présente dans le mail de confirmation de commande non plus.

J'ai remarqué que dans la table "order", lors de l'insertion en base de donnée dans la colonne "order_shipping_id" il insère la valeur 0.
Comment pourrais-je insérer la même valeur que dans la colonne "order_shipping_address_id" ?

Est-ce que hikashop mets à disposition une documentation technique pour développeur plus précise que celle de la page : https://www.hikashop.com/support/documentation/62-hikashop-developer-documentation.htmlhttps://www.hikashop.com/support/documentation/62-hikashop-developer-documentation.html ?

Une documentation pour utiliser les méthodes des classes du composant hikashop me permettrait peut-être de comprendre plus rapidement, le fonctionnement global d'hikashop ;)

Last edit: 7 years 5 months ago by skorweb.

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
7 years 5 months ago #271663

Bonjour,

Attention, order_shipping_id contient l'id de la méthode de livraison, alors que order_shipping_address_id contient l'id de l'adresse de livraison.
Mettre la même valeur dans ces deux colonnes n'a donc pas de sens.

Si order_shipping_id est à 0, cela indique qu'il n'y a pas de livraison. Dans ce cas, l'adresse de livraison n'est pas affichée.

Tout ceci est surement du au fait que vous utilisiez des variables pour une autre destination que celle prévu à la base.

Il n'y a pas de documentation plus précise que celle-ci. Maintenant, nous seront ravi de répondre à vos questions.
Aussi, les plugins existants sont également de bonnes sources d'inspiration.

Please Log in or Create an account to join the conversation.

  • Posts: 202
  • Thank you received: 3
7 years 1 month ago #280025

Bonjour

ce plugin pour DPD est il aujourd'hui fonctionnel et achetable ?

merci

cyril

Please Log in or Create an account to join the conversation.

  • Posts: 12
  • Thank you received: 0
7 years 1 month ago #280045

Bonjour,

Oui notre Plugin DPD est opérationnel et en production depuis le mois de Juillet 2017. Nous l'avons intégrer avec une version pour Hikashop 2.6 et une autre en Hikashop 3 ! Nous proposons différente formule avec prestations d'intégration et / ou maintenance du module en fonction des évolutions Joomla / Hikashop.

Merci de prendre contact en MP si vous êtes intéressé par ce type de prestation.

Bonne journée,

Damien.

Please Log in or Create an account to join the conversation.

  • Posts: 202
  • Thank you received: 3
7 years 1 month ago #280930

bonjour

nous attendons toujours ta reponse à ma question en MP sur le sujet stp
merci
cyril

Please Log in or Create an account to join the conversation.

Time to create page: 0.062 seconds
Powered by Kunena Forum