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

#   Using points to pay for purchase

##

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

Less More

- Posts: 208
- Thank you received: 10
-
-

12 years 9 months ago [\#145982](#145982) by [simmiepam](/forum/user/30436-simmiepam "View simmiepam's Profile")  *[Using points to pay for purchase](/forum/27-checkout/866233-using-points-to-pay-for-purchase#145982 "-- url of the page with the problem -- :   mywebsite.com/mypage  -- HikaShop version -- : 2.3.0 -- Joomla version -- : x.x -- PHP version -- : x.x.x -- Browser(s) name and version -- : XXXXX x.x.x -- Error-message(debug-mod must be tuned on) -- : Error&#95;message  I have the option turned on to allow customers to use points to pay for their purchase  The option, however, defaults to YES....I would like it to default to NO and then let the customer turn it on. I don't want them to see the points deducted and not realize they don't have to use them.  How can I do that?  Pam")* was created by *[simmiepam](/forum/user/30436-simmiepam "View simmiepam's Profile")*

-- url of the page with the problem -- : [ mywebsite.com/mypage](http://mywebsite.com/mypage)
-- HikaShop version -- : 2.3.0
-- Joomla version -- : x.x
-- PHP version -- : x.x.x
-- Browser(s) name and version -- : XXXXX x.x.x
-- Error-message(debug-mod must be tuned on) -- : Error_message

I have the option turned on to allow customers to use points to pay for their purchase

The option, however, defaults to YES....I would like it to default to NO and then let the customer turn it on.
I don't want them to see the points deducted and not realize they don't have to use them.

How can I do that?

Pam

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

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26402
- Thank you received: 4081
-
- [](http://obsi.dev)
-

12 years 9 months ago [\#146118](#146118) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Using points to pay for purchase](/forum/27-checkout/866233-using-points-to-pay-for-purchase#146118 "-- url of the page with the problem -- :   mywebsite.com/mypage  -- HikaShop version -- : 2.3.0 -- Joomla version -- : x.x -- PHP version -- : x.x.x -- Browser(s) name and version -- : XXXXX x.x.x -- Error-message(debug-mod must be tuned on) -- : Error&#95;message  I have the option turned on to allow customers to use points to pay for their purchase  The option, however, defaults to YES....I would like it to default to NO and then let the customer turn it on. I don't want them to see the points deducted and not realize they don't have to use them.  How can I do that?  Pam")*

Hi,

There is currently no option to set "no" as default for "use points" but it could be an interesting little improvement of the plugin.
For the moment the best will be to modify the plugin directly in order to change the default value.
In both plugins (hikashoppayment userpoint &amp; hikashop userpoints) you will find the code Code:

$app-&gt;getUserState(HIKASHOP_COMPONENT.'.userpoints_no_virtual_coupon', 0)

that you have to change into Code:

$app-&gt;getUserState(HIKASHOP_COMPONENT.'.userpoints_no_virtual_coupon', 1)

to modify the default value (0 to 1).

It requires some PHP skills to do such modification.

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

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

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

Less More

- Posts: 208
- Thank you received: 10
-
-

12 years 9 months ago [\#146178](#146178) by [simmiepam](/forum/user/30436-simmiepam "View simmiepam's Profile")  Replied by *[simmiepam](/forum/user/30436-simmiepam "View simmiepam's Profile")* on topic *[Using points to pay for purchase](/forum/27-checkout/866233-using-points-to-pay-for-purchase#146178 "-- url of the page with the problem -- :   mywebsite.com/mypage  -- HikaShop version -- : 2.3.0 -- Joomla version -- : x.x -- PHP version -- : x.x.x -- Browser(s) name and version -- : XXXXX x.x.x -- Error-message(debug-mod must be tuned on) -- : Error&#95;message  I have the option turned on to allow customers to use points to pay for their purchase  The option, however, defaults to YES....I would like it to default to NO and then let the customer turn it on. I don't want them to see the points deducted and not realize they don't have to use them.  How can I do that?  Pam")*

Thank you....I'll try it.

I want to learn, so this will be a challenge!

Thanks
Pam

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

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

Less More

- Posts: 208
- Thank you received: 10
-
-

12 years 9 months ago [\#146183](#146183) by [simmiepam](/forum/user/30436-simmiepam "View simmiepam's Profile")  Replied by *[simmiepam](/forum/user/30436-simmiepam "View simmiepam's Profile")* on topic *[Using points to pay for purchase](/forum/27-checkout/866233-using-points-to-pay-for-purchase#146183 "-- url of the page with the problem -- :   mywebsite.com/mypage  -- HikaShop version -- : 2.3.0 -- Joomla version -- : x.x -- PHP version -- : x.x.x -- Browser(s) name and version -- : XXXXX x.x.x -- Error-message(debug-mod must be tuned on) -- : Error&#95;message  I have the option turned on to allow customers to use points to pay for their purchase  The option, however, defaults to YES....I would like it to default to NO and then let the customer turn it on. I don't want them to see the points deducted and not realize they don't have to use them.  How can I do that?  Pam")*

OK...in my Control Panel I have found these 2 plugins and am ready to update the .php

My question is...

**For the Hikashop user points, which file do I alter?**

[ ![hce7b11f.jpg](/forum/attachment/15664) ](/forum/attachment/15664 "hce7b11f.jpg")

**And for the Hikashopuserpoints, which file do I alter?**

[ ![h57770d0.jpg](/forum/attachment/15665) ](/forum/attachment/15665 "h57770d0.jpg")

- [ ![hce7b11f.jpg](/forum/attachment/15664) ](/forum/attachment/15664 "hce7b11f.jpg") [ ](/forum/attachment/15664?download=1 "hce7b11f.jpg")
- [ ![h57770d0.jpg](/forum/attachment/15665) ](/forum/attachment/15665 "h57770d0.jpg") [ ](/forum/attachment/15665?download=1 "h57770d0.jpg")

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

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26402
- Thank you received: 4081
-
- [](http://obsi.dev)
-

12 years 9 months ago [\#146189](#146189) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Using points to pay for purchase](/forum/27-checkout/866233-using-points-to-pay-for-purchase#146189 "-- url of the page with the problem -- :   mywebsite.com/mypage  -- HikaShop version -- : 2.3.0 -- Joomla version -- : x.x -- PHP version -- : x.x.x -- Browser(s) name and version -- : XXXXX x.x.x -- Error-message(debug-mod must be tuned on) -- : Error&#95;message  I have the option turned on to allow customers to use points to pay for their purchase  The option, however, defaults to YES....I would like it to default to NO and then let the customer turn it on. I don't want them to see the points deducted and not realize they don't have to use them.  How can I do that?  Pam")*

Hi,

"userpoints.php" in both folders.
You will find two lines with the part of code I pasted. Please be careful to just replace the code I pasted with the other code block, do not remove more content, do not replace the all line.
You can do a "search &amp; replace" with the exact content if you want..

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

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

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

Less More

- Posts: 208
- Thank you received: 10
-
-

12 years 9 months ago [\#146193](#146193) by [simmiepam](/forum/user/30436-simmiepam "View simmiepam's Profile")  Replied by *[simmiepam](/forum/user/30436-simmiepam "View simmiepam's Profile")* on topic *[Using points to pay for purchase](/forum/27-checkout/866233-using-points-to-pay-for-purchase#146193 "-- url of the page with the problem -- :   mywebsite.com/mypage  -- HikaShop version -- : 2.3.0 -- Joomla version -- : x.x -- PHP version -- : x.x.x -- Browser(s) name and version -- : XXXXX x.x.x -- Error-message(debug-mod must be tuned on) -- : Error&#95;message  I have the option turned on to allow customers to use points to pay for their purchase  The option, however, defaults to YES....I would like it to default to NO and then let the customer turn it on. I don't want them to see the points deducted and not realize they don't have to use them.  How can I do that?  Pam")*

OK

I have found FIVE (5) lines with the text you gave me in the HIKASHOP

***Do I change ALL of them from 0 to 1?***

**1st one...**
$app = JFactory::getApplication();
$currencyClass = hikashop_get('class.currency');
$consume = null;
$discount = '';
$use_coupon = 1 - (int)$app-&gt;getUserState(HIKASHOP\_COMPONENT.'.userpoints\_no\_virtual\_coupon', 0);

**2nd one...**
function onAfterCheckoutStep($controllerName, &amp;$go_back, $original_go_back, &amp;$controller) {
if($controllerName == 'plg.shop.userpoints') {
$app = JFactory::getApplication();
$this-&gt;_readOptions();
if(empty($this-&gt;plugin_options)) {
$app-&gt;setUserState(HIKASHOP\_COMPONENT.'.userpoints\_no\_virtual\_coupon', 0);
return;
}

if(!empty($this-&gt;plugin_options)) {
$no_virtual_coupon = (int)$app-&gt;getUserState(HIKASHOP\_COMPONENT.'.userpoints\_no\_virtual\_coupon', 0);

$use_coupon_opt = JRequest::getString('userpoints_use_coupon', '');
if($use_coupon_opt !== '') {
$no_coupon = 1 - (int)$use_coupon_opt;
if($no_coupon != $no_virtual_coupon) {
$go_back = true;
$app-&gt;setUserState(HIKASHOP\_COMPONENT.'.userpoints\_no\_virtual\_coupon', $no\_coupon);
}
}
} else {
$app-&gt;setUserState(HIKASHOP\_COMPONENT.'.userpoints\_no\_virtual\_coupon', 0);

**IN THE OTHER FILE.... the one for HikashopPAYMENT &gt; userpoints, I found TWO (2) lines:**

***Do I change ALL of them from 0 to 1?***

***The first one...***
$app = JFactory::getApplication();
$currencyClass = hikashop_get('class.currency');
$consume = null;
$discount = '';
$use_coupon = 1 - (int)$app-&gt;getUserState(HIKASHOP\_COMPONENT.'.userpoints\_no\_virtual\_coupon', 0);

**The 2nd one...**
$app = JFactory::getApplication();
$no_virtual_coupon = (int)$app-&gt;getUserState(HIKASHOP\_COMPONENT.'.userpoints\_no\_virtual\_coupon', 0);
if(!empty($no_virtual_coupon)) {

$app = JFactory::getApplication();
$no_virtual_coupon = (int)$app-&gt;getUserState(HIKASHOP\_COMPONENT.'.userpoints\_no\_virtual\_coupon', 0);

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

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26402
- Thank you received: 4081
-
- [](http://obsi.dev)
-

12 years 9 months ago [\#146201](#146201) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Using points to pay for purchase](/forum/27-checkout/866233-using-points-to-pay-for-purchase#146201 "-- url of the page with the problem -- :   mywebsite.com/mypage  -- HikaShop version -- : 2.3.0 -- Joomla version -- : x.x -- PHP version -- : x.x.x -- Browser(s) name and version -- : XXXXX x.x.x -- Error-message(debug-mod must be tuned on) -- : Error&#95;message  I have the option turned on to allow customers to use points to pay for their purchase  The option, however, defaults to YES....I would like it to default to NO and then let the customer turn it on. I don't want them to see the points deducted and not realize they don't have to use them.  How can I do that?  Pam")*

Hi,

All " $app-&gt;getUserState(HIKASHOP_COMPONENT.'.userpoints_no_virtual_coupon', 0) "

Not " $app-&gt;**setUserState**(HIKASHOP_COMPONENT.'.userpoints_no_virtual_coupon', 0); "
Not " $app-&gt;**setUserState**(HIKASHOP_COMPONENT.'.userpoints_no_virtual_coupon', **$no\_coupon**); "

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

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

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

Less More

- Posts: 208
- Thank you received: 10
-
-

12 years 9 months ago [\#146213](#146213) by [simmiepam](/forum/user/30436-simmiepam "View simmiepam's Profile")  Replied by *[simmiepam](/forum/user/30436-simmiepam "View simmiepam's Profile")* on topic *[Using points to pay for purchase](/forum/27-checkout/866233-using-points-to-pay-for-purchase#146213 "-- url of the page with the problem -- :   mywebsite.com/mypage  -- HikaShop version -- : 2.3.0 -- Joomla version -- : x.x -- PHP version -- : x.x.x -- Browser(s) name and version -- : XXXXX x.x.x -- Error-message(debug-mod must be tuned on) -- : Error&#95;message  I have the option turned on to allow customers to use points to pay for their purchase  The option, however, defaults to YES....I would like it to default to NO and then let the customer turn it on. I don't want them to see the points deducted and not realize they don't have to use them.  How can I do that?  Pam")*

Yes, yes yes!!!!

That worked

Thank you!

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg2NjIzMy11c2luZy1wb2ludHMtdG8tcGF5LWZvci1wdXJjaGFzZT90bXBsPW1hcmtkb3du) 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.079 seconds

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