[Skip to main content](#vessel-content)

#   return url

##

- **[fania](/forum/user/72780-fania "View fania's Profile")**
- [![fania's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/72780-fania "View fania's Profile") Topic Author
- [ Offline](/forum/user/72780-fania)

Less More

- Posts: 6
- Thank you received: 0
-
-

3 years 9 months ago [\#349224](#349224) by [fania](/forum/user/72780-fania "View fania's Profile")  *[return url](/forum/27-checkout/905884-return-url#349224 "-- url of the page with the problem -- :   www.padelcabriolo.it  it is possible to indicate in return url the purchased items? (for example using alias url) i have many items in my shop and i need to know in return url which items has been purchased can i have and example?")* was created by *[fania](/forum/user/72780-fania "View fania's Profile")*

-- url of the page with the problem -- : [ www.padelcabriolo.it](http://www.padelcabriolo.it)

it is possible to indicate in return url the purchased items? (for example using alias url)
i have many items in my shop and i need to know in return url which items has been purchased
can i have and example?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0LzkwNTg4NC1yZXR1cm4tdXJsP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86593
- Thank you received: 14334
-
-

3 years 9 months ago [\#349227](#349227) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[return url](/forum/27-checkout/905884-return-url#349227 "-- url of the page with the problem -- :   www.padelcabriolo.it  it is possible to indicate in return url the purchased items? (for example using alias url) i have many items in my shop and i need to know in return url which items has been purchased can i have and example?")*

Hi,

Could you explain what the purpose of knowing the items bought is ?
In the default return URL you have the order_id, with that order_id, and a few lines of PHP code it's possible to know all the data of the order, including the data on the products.
What exact code to use and where to place it would depend on what you're trying to achieve.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0LzkwNTg4NC1yZXR1cm4tdXJsP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[fania](/forum/user/72780-fania "View fania's Profile")**
- [![fania's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/72780-fania "View fania's Profile") Topic Author
- [ Offline](/forum/user/72780-fania)

Less More

- Posts: 6
- Thank you received: 0
-
-

3 years 9 months ago -  3 years 9 months ago [\#349229](#349229) by [fania](/forum/user/72780-fania "View fania's Profile")  Replied by *[fania](/forum/user/72780-fania "View fania's Profile")* on topic *[return url](/forum/27-checkout/905884-return-url#349229 "-- url of the page with the problem -- :   www.padelcabriolo.it  it is possible to indicate in return url the purchased items? (for example using alias url) i have many items in my shop and i need to know in return url which items has been purchased can i have and example?")*

thanks for support.
i use hikashop in order to permit to registered user to buy coin.
I need to know if the user buy items "1 coin" or items "10 coin" because after the succesfull payment i need (with my php code) to add the correct number of coin to the user profile. so i need that the return url is a custom php page (created by myself) because i need with a php code add the coin to the user.
How i can manage this situation?
thanks

Last edit: 3 years 9 months ago by [fania](/forum/user/72780-fania "View fania's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0LzkwNTg4NC1yZXR1cm4tdXJsP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86593
- Thank you received: 14334
-
-

3 years 9 months ago [\#349235](#349235) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[return url](/forum/27-checkout/905884-return-url#349235 "-- url of the page with the problem -- :   www.padelcabriolo.it  it is possible to indicate in return url the purchased items? (for example using alias url) i have many items in my shop and i need to know in return url which items has been purchased can i have and example?")*

Hi,

So, which payment plugin are you using ? Normally a "return URL" is where the user is redirected back after paying on the payment gateway. And generally, you don't run code in the "return URL". You run code in the "onAfterOrderUpdate event by checking that $order-&gt;order_status is set to "confirmed" and that $order-&gt;old-&gt;order_status is not "confirmed". That will tell you that the order is currently being confirmed after a successful payment.
What's great with this method is that it should work with any payment method. Even if you manually confirm the orders in the HikaShop backend (after a bank transfer is received for example).
You can read more about how to write a plugin for HikaShop here:
[ www.hikashop.com/support/documentation/6...r-documentation.html](https://www.hikashop.com/support/documentation/62-hikashop-developer-documentation.html)
And more about this event here:
[ www.hikashop.com/support/documentation/6...l#onAfterOrderUpdate](https://www.hikashop.com/support/documentation/62-hikashop-developer-documentation.html#onAfterOrderUpdate)

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0LzkwNTg4NC1yZXR1cm4tdXJsP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[fania](/forum/user/72780-fania "View fania's Profile")**
- [![fania's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/72780-fania "View fania's Profile") Topic Author
- [ Offline](/forum/user/72780-fania)

Less More

- Posts: 6
- Thank you received: 0
-
-

3 years 9 months ago [\#349260](#349260) by [fania](/forum/user/72780-fania "View fania's Profile")  Replied by *[fania](/forum/user/72780-fania "View fania's Profile")* on topic *[return url](/forum/27-checkout/905884-return-url#349260 "-- url of the page with the problem -- :   www.padelcabriolo.it  it is possible to indicate in return url the purchased items? (for example using alias url) i have many items in my shop and i need to know in return url which items has been purchased can i have and example?")*

i use paypal pluigin. can i pass in the return url the order id by parameter?
in the return url php page how i can extract the product ordered knowing the order id?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0LzkwNTg4NC1yZXR1cm4tdXJsP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86593
- Thank you received: 14334
-
-

3 years 9 months ago [\#349262](#349262) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[return url](/forum/27-checkout/905884-return-url#349262 "-- url of the page with the problem -- :   www.padelcabriolo.it  it is possible to indicate in return url the purchased items? (for example using alias url) i have many items in my shop and i need to know in return url which items has been purchased can i have and example?")*

You can add the order id in the return URL by adding the tag {order_id} to the return URL.
On the return URL, you can use the loadFullOrder method of class.order to get all the data of the order, including the products in the products array attribute. You can see an example code in our developer documentation:
[ www.hikashop.com/support/documentation/6...umentation.html#code](https://www.hikashop.com/support/documentation/62-hikashop-developer-documentation.html#code)

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0LzkwNTg4NC1yZXR1cm4tdXJsP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[fania](/forum/user/72780-fania "View fania's Profile")**
- [![fania's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/72780-fania "View fania's Profile") Topic Author
- [ Offline](/forum/user/72780-fania)

Less More

- Posts: 6
- Thank you received: 0
-
-

3 years 9 months ago [\#349607](#349607) by [fania](/forum/user/72780-fania "View fania's Profile")  Replied by *[fania](/forum/user/72780-fania "View fania's Profile")* on topic *[return url](/forum/27-checkout/905884-return-url#349607 "-- url of the page with the problem -- :   www.padelcabriolo.it  it is possible to indicate in return url the purchased items? (for example using alias url) i have many items in my shop and i need to know in return url which items has been purchased can i have and example?")*

good morning
in the return page i use this code but i don't show the prodcuts name. what is the error?

$orderClass = hikashop_get('class.order');

$app =&amp; JFactory::getApplication();
$order_id = $app-&gt;getUserState('com_hikashop.order_id');

$order = $orderClass-&gt;loadFullOrder($order_id, true, false);

foreach($order-&gt;products as $product) {
echo $product-&gt;product_name.'&lt;br/&gt;';
}

thanks

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0LzkwNTg4NC1yZXR1cm4tdXJsP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86593
- Thank you received: 14334
-
-

3 years 9 months ago -  3 years 9 months ago [\#349609](#349609) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[return url](/forum/27-checkout/905884-return-url#349609 "-- url of the page with the problem -- :   www.padelcabriolo.it  it is possible to indicate in return url the purchased items? (for example using alias url) i have many items in my shop and i need to know in return url which items has been purchased can i have and example?")*

Hi,

The issue is probably that you're not able to retrieve the order_id for some reason.
The code: Code:

$app =&amp; JFactory::getApplication(); $order_id = $app-&gt;getUserState('com_hikashop.order_id');

will retrieve the order_id from the user session. This variable is normally set by HikaShop when it creates the order, before redirecting to the payment gateway.
If the user session changes for whatever reason between the order creation and the redirection to the return page, it's possible this will set $order_id to "null".
You added the tag {order_id} to the return URL to add the order_id in the URL.
For example, suppose you've used the return URL : Code:

https://www.hikashop.com/extensions/hika-business.html?my_variable={order_id}

In that case, you can use this code to get the order_id: Code:

$order_id = (int)$_REQUEST['my_variable'];

Last edit: 3 years 9 months ago by [nicolas](/forum/user/63-nicolas "View nicolas's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0LzkwNTg4NC1yZXR1cm4tdXJsP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[fania](/forum/user/72780-fania "View fania's Profile")**
- [![fania's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/72780-fania "View fania's Profile") Topic Author
- [ Offline](/forum/user/72780-fania)

Less More

- Posts: 6
- Thank you received: 0
-
-

3 years 7 months ago [\#351232](#351232) by [fania](/forum/user/72780-fania "View fania's Profile")  Replied by *[fania](/forum/user/72780-fania "View fania's Profile")* on topic *[return url](/forum/27-checkout/905884-return-url#351232 "-- url of the page with the problem -- :   www.padelcabriolo.it  it is possible to indicate in return url the purchased items? (for example using alias url) i have many items in my shop and i need to know in return url which items has been purchased can i have and example?")*

ok thanks now i can read order_id in the return page
but i still can't detect the product ordered, the following code don't work i don't see anything print on the screen

$orderClass = hikashop_get('class.order');
$order = $orderClass-&gt;loadFullOrder($order_id, true, false);
foreach($order-&gt;products as $product) {
echo $product-&gt;product_name.'&lt;br/&gt;';
}

thanks

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0LzkwNTg4NC1yZXR1cm4tdXJsP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86593
- Thank you received: 14334
-
-

3 years 7 months ago [\#351234](#351234) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[return url](/forum/27-checkout/905884-return-url#351234 "-- url of the page with the problem -- :   www.padelcabriolo.it  it is possible to indicate in return url the purchased items? (for example using alias url) i have many items in my shop and i need to know in return url which items has been purchased can i have and example?")*

Hi,

It should be order_product_name and not product_name

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0LzkwNTg4NC1yZXR1cm4tdXJsP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[fania](/forum/user/72780-fania "View fania's Profile")**
- [![fania's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/72780-fania "View fania's Profile") Topic Author
- [ Offline](/forum/user/72780-fania)

Less More

- Posts: 6
- Thank you received: 0
-
-

3 years 7 months ago [\#351296](#351296) by [fania](/forum/user/72780-fania "View fania's Profile")  Replied by *[fania](/forum/user/72780-fania "View fania's Profile")* on topic *[return url](/forum/27-checkout/905884-return-url#351296 "-- url of the page with the problem -- :   www.padelcabriolo.it  it is possible to indicate in return url the purchased items? (for example using alias url) i have many items in my shop and i need to know in return url which items has been purchased can i have and example?")*

ok thanks
in order to know the price of the items in order what is the variable to read?
thanks

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0LzkwNTg4NC1yZXR1cm4tdXJsP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86593
- Thank you received: 14334
-
-

3 years 7 months ago [\#351300](#351300) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[return url](/forum/27-checkout/905884-return-url#351300 "-- url of the page with the problem -- :   www.padelcabriolo.it  it is possible to indicate in return url the purchased items? (for example using alias url) i have many items in my shop and i need to know in return url which items has been purchased can i have and example?")*

It's $product-&gt;order_product_price
The tax is in $product-&gt;order_product_tax and the quantity in $product-&gt;order_product_quantity

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0LzkwNTg4NC1yZXR1cm4tdXJsP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.109 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
