Checkout with UserPoint

  • Posts: 129
  • Thank you received: 0
7 years 2 months ago #277107

hello,
i'm using user point as a payment method.
i have 2 options that user can click on "yes" and "no" to apply the discount of userpoint or not.

my problem is that the structure of this input radio buttons is some how complecated.
i want to target the label of the input that is checked but as the input is inside the label i cannot do that.
and also there is no other tag inside the label next to input it's just yes or no text.

i tried to add a "<span></span>" tag aftre input inside label with java but after clicking on yes or no button the ajax refresh of hikashop make them removed.

i was wondering if you can tell me how can i access the structure of the yse or no button inside .hikashop_userpoints_status_question div and move the input out off label and put it before label started.
or even add a tag inside label next to input so the text of label or the label itself can be targeted when input is checked or not .

i've found this line of code that i think produce this structure but i cann't find out how to change it .
Path: administrator/components/com_hikashop/extensions/plg_hikashop_userpoints/userpoints_checkout.php

if(!empty($this->legacy)) {
					echo JHTML::_('hikaselect.booleanlist', 'userpoints_use_coupon', 'onchange="this.form.submit();"', $use_coupon);
				} else {
					echo JHTML::_('hikaselect.booleanlist', 'userpoints_use_coupon', "onchange=\"if(window.checkout) return window.checkout.submitUserpoints(".$this->step.",".$this->module_position.");\"", $use_coupon);
				}

i appreciate any help on this case
Thanks

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

  • Posts: 82868
  • Thank you received: 13376
  • MODERATOR
7 years 2 months ago #277113

Hi,

There are several ways to go about it based on what you want to do.
- You could modify the administrator/components/com_hikashop/helpers/joomla30.php file where the HTML is generated.
- You might be able to do what you want with pure CSS stackoverflow.com/questions/26501827/wha...nput-is-inside-label
- You could simply modify the plugins/hikashop/userpoints/userpoints_checkout.php file to add a str_replace to add your extra HTML to the HTML of the input.
-You could add your javascript after the line

window.checkout.refreshUserpoints(<?php echo (int)$this->step; ?>, <?php echo (int)$this->module_position; ?>);
in that plugins/hikashop/userpoints/userpoints_checkout.php file so that it would run after each refresh.

Note that the file administrator/components/com_hikashop/extensions/plg_hikashop_userpoints/userpoints_checkout.php is not used by HikaShop. It's where the plugins/modules files are stored before the installation of these modules/plugins in their destination folders in /modules/ or /plugins/.

The following user(s) said Thank You: nic7071

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

  • Posts: 129
  • Thank you received: 0
7 years 2 months ago #277205

Hi,
I've used your advice on placing my code after the check out refresh line and every thing is running smoothly now.
also, i was wondering my changes in the admin path is not applying.
so thank you for your pieces of advice man!

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

Time to create page: 0.057 seconds
Powered by Kunena Forum