Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

Product Price Converted to Rewards Points VALUE

 
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)
 
Thread Tools Search this Thread
  #1  
Old 07-16-2020, 08:45 PM
  Blainevk's Avatar 
Blainevk Blainevk is offline
 

Senior Member
  
Join Date: Dec 2004
Location: Atlanta, GA
Posts: 162
 

Default Product Price Converted to Rewards Points VALUE

Hello,

When I had an Xcart 4 (classic) Store, I had someone do a conversion for me where it would automatically convert the Price of the product into the quantity of Rewards Points needed to redeem for the same product, so the shopper could see BOTH Dollar Value & Rewards Points Value needed.

The conversion was:

{math|formatnumeric:',' equation="price * 1000 + 5" price = $product.price}

What needs to be changed in this conversion to work with Xcart 5 Multivendor?

ALSO:

How would the same conversion be added to this Xcart 5 Multivendor template:

<div class="product-price {{ this.getFingerprint() }}">
<ul class="product-price product-price-range">
<li class="product-price-base"><span class="price product-price min-of-range">{{ this.formatPrice(this.getMinListPrice(), this.null, 1)|raw }}</span></li>
<li class="product-price-base"><span class="price product-price range-delimiter">{{ this.getPriceRangeDelimiter() }}</span></li>
<li class="product-price-base"><span class="price product-price max-of-range">{{ this.formatPrice(this.getMaxListPrice(), this.null, 1)|raw }}</span></li>
</ul>
</div>

Thanks in advance for your help.
__________________
Blaine

X-Cart Multi-vendor 5.4.1.35
PHP version: 8.1

Blaine's Travel Club - http://blainestravelclub.com

Collect Travel Points - http://blainestravelclub.com/travelpoints/rewards/

Travel Points Gift Mall - https://blainestravelclub.com/travelpoints/giftmall/

Grow Your Business - http://blainestravelclub.com/business/

Making Money & Fun - http://blainestravelclub.com/travelers/

Charitable Fun-razing - http://blainestravelclub.com/fun-razors
Reply With Quote
  #2  
Old 07-17-2020, 04:05 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,190
 

Default Re: Product Price Converted to Rewards Points VALUE

You will need custom module to do that and to modify the appropriate template to show the numbers.

You can do something like

{{ (this.getMinListPrice() * 1000) + 5 }}

which will do the math and place it in the template but it looks cumbersome


Code:
<div class="product-price {{ this.getFingerprint() }}"> <ul class="product-price product-price-range"> <li class="product-price-base"><span class="price product-price min-of-range">{{ this.formatPrice(this.getMinListPrice(), this.null, 1)|raw }}</span></li> <li class="product-price-base"><span class="price product-price range-delimiter">{{ this.getPriceRangeDelimiter() }}</span></li> <li class="product-price-base"><span class="price product-price max-of-range">{{ this.formatPrice(this.getMaxListPrice(), this.null, 1)|raw }}</span></li> </ul> <ul class="product-price product-price-range"> <li class="product-price-base"><span class="price product-price min-of-range">{{ (this.getMinListPrice() * 1000) + 5 }}</span></li> <li class="product-price-base"><span class="price product-price range-delimiter">{{ this.getPriceRangeDelimiter() }}</span></li> <li class="product-price-base"><span class="price product-price max-of-range">{{ (this.getMaxListPrice() * 1000) + 5 }}</span></li> </ul> </div>
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #3  
Old 07-18-2020, 04:18 PM
  Blainevk's Avatar 
Blainevk Blainevk is offline
 

Senior Member
  
Join Date: Dec 2004
Location: Atlanta, GA
Posts: 162
 

Default Re: Product Price Converted to Rewards Points VALUE

Hi Steve,

Thanks so much for your help on this!

It took a little trial & error, but it worked exactly how i wanted it to! If you would like to see the finished product look here...

https://blainespartynetwork.net/partypoints/giftmall/

Here is the finished code that I used:

{##
# Price widget
#}
<br>
<div class="product-price {{ this.getFingerprint() }}">
<ul class="product-price product-price-range">
This item FREE with<br>
<li class="product-price-base"><span style="color: #bd0014; font-size: 24px;" class="price product-price min-of-range">{{ (this.getMinListPrice() * 1000) + 0 }}</span></li>
<li class="product-price-base"><span style="color: #bd0014; font-size: 24px;" class="price product-price range-delimiter">{{ this.getPriceRangeDelimiter() }}</span></li>
<li class="product-price-base"><span style="color: #bd0014; font-size: 24px;" class="price product-price max-of-range">{{ (this.getMaxListPrice() * 1000) + 0 }}&nbsp;<img src="http://blainespartynetwork.net/partypoints/giftmall/images/poker_chip_store.png" width="32px" alt="" /></span></li>
</ul>

or pay cash or use both!

<ul class="product-price product-price-range">
<li class="product-price-base"><span class="price product-price min-of-range">{{ this.formatPrice(this.getMinListPrice(), this.null, 1)|raw }}</span></li>
<li class="product-price-base"><span class="price product-price range-delimiter">{{ this.getPriceRangeDelimiter() }}</span></li>
<li class="product-price-base"><span class="price product-price max-of-range">{{ this.formatPrice(this.getMaxListPrice(), this.null, 1)|raw }}</span></li>
</ul>
</div>


Now, the only thing I need is for the code to place a "comma" at the thousand mark like it did in the old Xcart 4 version: {math|formatnumeric:',' equation="price * 1000 + 5" price = $product.price}... I'm assuming the "{math|formatnumeric:',' " in the code is what made that happen\, but I couldn't figure out how to that into the current Xcart version to make it work... Any ideas? Different code needed?

Thanks again & looking forward to your reply,
Blaine
__________________
Blaine

X-Cart Multi-vendor 5.4.1.35
PHP version: 8.1

Blaine's Travel Club - http://blainestravelclub.com

Collect Travel Points - http://blainestravelclub.com/travelpoints/rewards/

Travel Points Gift Mall - https://blainestravelclub.com/travelpoints/giftmall/

Grow Your Business - http://blainestravelclub.com/business/

Making Money & Fun - http://blainestravelclub.com/travelers/

Charitable Fun-razing - http://blainestravelclub.com/fun-razors
Reply With Quote
  #4  
Old 07-19-2020, 06:23 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,190
 

Default Re: Product Price Converted to Rewards Points VALUE

The price format is something you can set from admin. Thousands delimiter, decimals delimiter, sign, zeros, etc. Look in the settings.
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 11:22 AM.

   

 
X-Cart forums © 2001-2020