Jump to content

Creating pass in Passbook when order is made


Heliguy

Recommended Posts

Hello,

 

I would like to run Prestashop so that when an order (booking) is made. A link exists on the Order Confirmation page at the end of the checkout, and in the order confirmation E-Mail that takes the user to a PHP script that takes the Name and order number, and creates a Pass for Passbook with the API from https://www.passsource.com/.

 

My question is, how do you insert the name and order number from the order into the script. I have tried to make the script simply echo the name of the shop, but it won't even echo that.

<?php
global $smarty;
include(dirname(__FILE__).'/config/config.inc.php');


echo $shop_name;


?>

 

Link to comment
Share on other sites

Variables like $shop_name do not just magically exist for you to use.  Since we are discussing Order Confirmation, you would need to look at the OrderConfirmationController to see what variables it places into the smarty engine.  The answer is that it does not place any variables into the smarty engine.

 

So you could either

1) edit / override the OrderConfirmationController to add the variables you want to use, and then edit the themes order-confirmation.tpl to include your code.  This is not the best practice way of doing things

 

2) Create a module that uses the displayOrderConfirmation hook.  Your module would obtain the shop name and order reference number, add them to the smarty engine, and then inject html/javascript as required by the API to create the passbook

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...