user points

  • Posts: 1119
  • Thank you received: 114
8 years 10 months ago #227947

Hi,

1. I have succesfully added some div classes to userpoints_checkout.php and i almost have what i need. I enabled boostrap to have buttons instead of radioboxes where is yes,no....However i want to add my own button class to userpoints button labels. Which file i should modify?

2. i would like not to display message how many points you got after order is finished but insteed add it to order details like hikashop bank transfer plugin. If someone could tell me how to get rid of that message and what code i could use to display in payment plugin i would be very thankful.


Thanks

Last edit: 8 years 10 months ago by kyratn.

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

  • Posts: 82868
  • Thank you received: 13378
  • MODERATOR
8 years 9 months ago #227959

Hi,

1. The inputs are generated in Joomla. You can't modify their generation directly. Instead just modify the userpoints_checkout.php file and add a str_replace.
For example:

echo str_replace('class="','class="my_class ',JHTML::_('hikaselect.booleanlist', 'userpoints_use_coupon', 'onchange="this.form.submit();"', $use_coupon));

2. You can use a translation override in order to change that message. Removing it completely would require modifying the code of the plugin directly:
if($points < 0)
					$app->enqueueMessage(JText::sprintf('HIKAPOINTS_USE_X_POINTS', -$points));
				else
					$app->enqueueMessage(JText::sprintf('HIKAPOINTS_EARN_X_POINTS', $points));
and you would loose it during the updates so I would not recommend it but it's possible.

I'm not sure what you mean by "add it to order details like hikashop bank transfer plugin". The bank transfer plugin doesn't add any message to the order details. Where exactly do you want to add a message ?
It might be more complex since it might mean that you would have to save the points somewhere in the order in order to be able to display it later on. In that case, I'm afraid that it will require a developer to do that by creating a new column in the order table, storing the $points from the code above along with the order entry in that new column of the order table with a MySQL query, and then customizing the view(s) where you want to display the points to load the points and display them.

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

  • Posts: 1119
  • Thank you received: 114
8 years 9 months ago #228069

Hi,

Thank you for replay Nicolas.

1. Understood, thanks

2. I mean to add code which would show how many user points buyer got for this order. Similar to message displayed it just it wouldnt be in that message but insteed in my desired location.

Something like this:

Thanks for your order.
Your order number is:xxxxx
You have earned x points with this order

I do have article which is thank you page and using sourcerer i would like to display it as i did with order number. Hope it is more clear now.

Thanks

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

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

Hi,

Basically, only the plugin can know how many points has been used or earn in an order.
Afterwards, the data is stored in the order object but you will have to retrieve that information yourself and that is not something really easy to do.

So ; yes, it is possible to display that in a "thank you" page but it will require some development/PHP skills to do so.
Specially when you have to unserialize some data in the order object (order_payment_params) and extract some specific information about the points.

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.

Time to create page: 0.060 seconds
Powered by Kunena Forum