Trusted Shops integration

  • Posts: 203
  • Thank you received: 0
9 years 10 months ago #186926

-- HikaShop version -- : HikaShop Business 2.3.4
-- Joomla version -- : 3.3.6
-- PHP version -- : 5.4.30
-- Browser(s) name and version -- : Firefox 35

Hello support Team,

i need to know the values used by hikashop for the bold written values.

Maybe you could be of assistence.

<div id="trustedShopsCheckout" style="display: none;">
<span id="tsCheckoutOrderNr">%Value: ORDER_NUMBER%</span>
<span id="tsCheckoutBuyerEmail">%Value: BUYER_EMAIL_ADDRESS%</span>
<span id="tsCheckoutBuyerId">%Value: CUSTOMER_ID%</span>
<span id="tsCheckoutOrderAmount">%Value: SHOPPING_BASKET_TOTAL%</span>
<span id="tsCheckoutOrderCurrency">%Value: ORDER_CURRENCY%</span>
<span id="tsCheckoutOrderPaymentType">%Value: PAYMENT_METHOD%</span>
</div>

<span id="tsCheckoutBuyerEmail"><?php echo $customer_email; ?></span>


Thx

Andreas

Last edit: 9 years 10 months ago by CMS-Buttler.

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
9 years 10 months ago #186931

Hi,

I don't know what you are talking about.

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: 203
  • Thank you received: 0
9 years 10 months ago #187163

I want to know the name of the fields used by hikashop for

ORDER_NUMBER
BUYER_EMAIL_ADDRESS
CUSTOMER_ID
SHOPPING_BASKET_TOTAL
ORDER_CURRENCY
PAYMENT_METHOD
customer_email

these are examples from Trusted Shops for a widget. I need to put the field names used by hikashop in it to work correctly

thx

Andreas

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

  • Posts: 193
  • Thank you received: 76
9 years 10 months ago #187176

When (in which view) you need to display this widget?

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

  • Posts: 203
  • Thank you received: 0
9 years 10 months ago #187186

Own page in joomla

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
9 years 10 months ago #187203

Hi,

Thanks Korzo :)

@CMS-Butter : Sorry, I still don't understand ; I don't know what is this widget and what you want to achieve.
The values you are asking for could be retrieve but only on some specific conditions so I don't think that's you really want to know.
So, please ; provide some explanations and some details... A lot of details !
Because for the moment I can't give you any answer ; it does not have any sense for me.

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: 203
  • Thank you received: 0
9 years 10 months ago #187299

www.trustedshops.co.uk/support/trustbadge/

Step 3.

This is for what i need the info

Thx

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
9 years 10 months ago #187351

Hi,

You could add such code:

<?php
$app = JFactory::getApplication():
$id = $app->getUserState('com_hikashop.order_id'); 
$orderClass = hikashop_get('class.order');
$order = $orderClass->loadFullOrder($id,true,false);
?>
<div id="trustedShopsCheckout" style="display: none;">
<span id="tsCheckoutOrderNr"><?php echo $order->order_number; ?></span>
<span id="tsCheckoutBuyerEmail"><?php echo $order->customer->user_email; ?></span>
<span id="tsCheckoutBuyerId"><?php echo $order->customer->user_id; ?></span>
<span id="tsCheckoutOrderAmount"><?php echo $order->order_full_price; ?></span>
<span id="tsCheckoutOrderCurrency">EUR</span>
<span id="tsCheckoutOrderPaymentType"><?php echo $order->order_payment_method; ?></span>
</div>
Either in the "after_end" or the "end" view file (depending on the payment method you're using) of the "checkout" view via the menu Display>Views

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

  • Posts: 203
  • Thank you received: 0
9 years 10 months ago #187418

Hello Nicolas

thx

what about a own Joomla article?

is it possible too?

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

  • Posts: 203
  • Thank you received: 0
9 years 10 months ago #187434

nicolas wrote: Hi,

You could add such code:

<?php
$app = JFactory::getApplication():
$id = $app->getUserState('com_hikashop.order_id'); 
$orderClass = hikashop_get('class.order');
$order = $orderClass->loadFullOrder($id,true,false);
?>
<div id="trustedShopsCheckout" style="display: none;">
<span id="tsCheckoutOrderNr"><?php echo $order->order_number; ?></span>
<span id="tsCheckoutBuyerEmail"><?php echo $order->customer->user_email; ?></span>
<span id="tsCheckoutBuyerId"><?php echo $order->customer->user_id; ?></span>
<span id="tsCheckoutOrderAmount"><?php echo $order->order_full_price; ?></span>
<span id="tsCheckoutOrderCurrency">EUR</span>
<span id="tsCheckoutOrderPaymentType"><?php echo $order->order_payment_method; ?></span>
</div>
Either in the "after_end" or the "end" view file (depending on the payment method you're using) of the "checkout" view via the menu Display>Views


Hello nicolas this does not work.

Just getting a white page.

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

  • Posts: 13201
  • Thank you received: 2322
9 years 10 months ago #187442

Hi,

If you are able to add php code inside an article, so yes you can use that code.
It get the id of the order in the user session, so it can be used anywhere.

The white page means that you have a php error, so please set the Joomla error reporting level to "maximum" to see the details of the error.

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

  • Posts: 12
  • Thank you received: 0
9 years 9 months ago #188317

Hi,
I am using trustedbadge on my hika shop website. I want to be able to collect reviews from shoppers after they make a purchase. Here is a link from Trusted Shops on how to do this:
www.trustedshops.co.uk/support/trustbadge/#step1

As CMS Butler wrote we need to get the correct values for these fields from hikashop in order for this to work. Can you tell me if hikashop uses these field names or what are the correct ones. See below:
Insert a DIV element onto the Order Confirmation (Thank you) page of your shop. This element will ensure the rate later card is initiated, asking your customers to leave a review after their purchase.

In order to ease the review process for your customers, we recommend you pre-fill the required order data in the integration code. This way your customers will not have to fill in the form by themselves.

Before you start you should check our list of shopsoftware specific step-by-step guides you find here for your shopsoftware. Those guides are more specific and get you up and running fast.

<div id="trustedShopsCheckout" style="display: none;">
<span id="tsCheckoutOrderNr">%Value: ORDER_NUMBER%</span>
<span id="tsCheckoutBuyerEmail">%Value: BUYER_EMAIL_ADDRESS%</span>
<span id="tsCheckoutBuyerId">%Value: CUSTOMER_ID%</span>
<span id="tsCheckoutOrderAmount">%Value: SHOPPING_BASKET_TOTAL%</span>
<span id="tsCheckoutOrderCurrency">%Value: ORDER_CURRENCY%</span>
<span id="tsCheckoutOrderPaymentType">%Value: PAYMENT_METHOD%</span>
</div>

The values of the parameters should be filled in using the script language used by your shop system.

For example, in PHP the transfer of the e-mail address could look as follows, where $customer_email corresponds to the internal name given to the customer's e-mail address in your shop system:

<span id="tsCheckoutBuyerEmail"><?php echo $customer_email; ?></span>

The email address and order number is mandatory for the process asking your customers to leave a review after their purchase. We recommend to submit all values in addition.

That’s it! Your Trustbadge® will now start automatically collecting reviews from your customers.

__________________
Thanks, b

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
9 years 9 months ago #188362

Hi,

Nicolas already provide a working code which can display the wanted content on several specific pages.
www.hikashop.com/forum/orders-management...egration.html#187351

And I insist on the several specific pages ; not all pages and not a lambda page.
Like Nicolas wrote :

Either in the "after_end" or the "end" view file (depending on the payment method you're using) of the "checkout" view via the menu Display>Views


So, please follow the indications and if you have any trouble with the code, please check your PHP error log or activate the Joomla debug mode in your Joomla global configuration in order to have more details about your issue.

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
9 years 9 months ago #188696

Hi Jerome,
On the code Nicolas put up on this post he has:
<span id="tsCheckoutOrderCurrency">EUR</span>
But on my shop we have multi currency, what code should replace Euro to capture the currency used?
thanks,

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

  • Posts: 12953
  • Thank you received: 1778
9 years 9 months ago #188748

Hello,
A solution can be to use the hikashop_getCurrency() function which will give you the ID of the current currency used, then you'll just have to use that kind of SQL request to have more information about that currency :

$query = 'SELECT * FROM '.hikashop_table('currency').' WHERE currency_id = '.hikashop_getCurrency();

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

  • Posts: 2
  • Thank you received: 0
9 years 4 months ago #206677

in templates/$template/html/com_hikashop/checkout/end.php

<?php
/**
 * @package	HikaShop for Joomla!
 * @version	2.3.1
 * @author	hikashop.com
 * @copyright	(C) 2010-2014 HIKARI SOFTWARE. All rights reserved.
 * @license	GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
 */
defined('_JEXEC') or die('Restricted access');
?>

<?php
$app = JFactory::getApplication();
$id = $app->getUserState('com_hikashop.order_id'); 
$orderClass = hikashop_get('class.order');
$order = $orderClass->loadFullOrder($id,true,false);

if(empty($this->html)){
	echo JText::_('THANK_YOU_FOR_PURCHASE');
}else{
	echo $this->html;
	echo '<div id="trustedShopsCheckout" style="display: none;">';

	echo '<span id="tsCheckoutOrderNr">';
	echo $order->order_number;
	echo '</span>';
	echo '<span id="tsCheckoutBuyerEmail">';
	echo $order->customer->user_email;
	echo '</span>';
	echo '<span id="tsCheckoutBuyerId">';
	echo $order->customer->user_id;
	echo '</span>';	
	echo '<span id="tsCheckoutOrderAmount">';
	echo $order->order_full_price;
	echo '</span>';		
	echo '<span id="tsCheckoutOrderCurrency">EUR</span>';
	echo '<span id="tsCheckoutOrderPaymentType">';
	echo $order->order_payment_method;
	echo '</span>';	
	echo '</div>';
}
$this->nextButton = false;


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

  • Posts: 2
  • Thank you received: 1
  • Hikashop Business
2 years 4 months ago #343005

New Version - working for me:

<?php
/**
 * @package	HikaShop for Joomla!
 * @version	4.6.0
 * @author	hikashop.com
 * @copyright	(C) 2010-2022 HIKARI SOFTWARE. All rights reserved.
 * @license	GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
 */
defined('_JEXEC') or die('Restricted access');
?>
<?php
$app = JFactory::getApplication();
$id = $app->getUserState('com_hikashop.order_id'); 
$orderClass = hikashop_get('class.order');
$order = $orderClass->loadFullOrder($id,true,false);
if(empty($this->html)) {
	echo JText::_('THANK_YOU_FOR_PURCHASE');
	if(!empty($this->url))
		echo '<br/>'.JText::sprintf('YOU_CAN_NOW_ACCESS_YOUR_ORDER_HERE', $this->url);
} else {
	echo $this->html;
  	echo '<div id="trustedShopsCheckout" style="display: none;">';

	echo '<span id="tsCheckoutOrderNr">';
	echo $order->order_number;
	echo '</span>';
	echo '<span id="tsCheckoutBuyerEmail">';
	echo $order->customer->user_email;
	echo '</span>';
	echo '<span id="tsCheckoutBuyerId">';
	echo $order->customer->user_id;
	echo '</span>';	
	echo '<span id="tsCheckoutOrderAmount">';
	echo $order->order_full_price;
	echo '</span>';		
	echo '<span id="tsCheckoutOrderCurrency">EUR</span>';
	echo '<span id="tsCheckoutOrderPaymentType">';
	echo $order->order_payment_method;
	echo '</span>';	
	echo '</div>';
}
$this->nextButton = false;

The following user(s) said Thank You: nicolas

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

Time to create page: 0.140 seconds
Powered by Kunena Forum