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

Percentage Price Modifier to discount other price modifiers?

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 01-10-2011, 07:05 AM
 
frgsBC frgsBC is offline
 

Member
  
Join Date: Apr 2010
Posts: 22
 

Default Percentage Price Modifier to discount other price modifiers?

Hi,

On certain products my client wants to allow the customer to pay just a 50% deposit at the point of order ( as products can be a few thousand pounds in price).

Now I achieved this using a price modifier option as discussed here

However when a product has other price modifier options at an absolute price, this modifier is not halved in the total price.

For example :

Product X
Base Price - ё1000
Option 1 - +ё200
Deposit Option - -50%

Xcart calculates the total for the above as ё700

(1000 * 0.5)+200 = 700

However In this example I need the total to be ё600
(1000 + 200) *0.5 = 600

Does anybody know how I can achieve this?
__________________
X-Cart version 4.3.0 <-- some sites I look after
X-Cart Version 4.4.0 < -- some other sites i look after
Reply With Quote
  #2  
Old 01-10-2011, 07:50 AM
 
frgsBC frgsBC is offline
 

Member
  
Join Date: Apr 2010
Posts: 22
 

Default Re: Percentage Price Modifier to discount other price modifiers?

I seem to have worked it out, below is the necessary modifictaion if anybody else needs to do this.

File : include/func/func.cart.php around line 2700

Change from
Code:
foreach($product_options as $o) { $products_array['options_surcharge'] += ( $o['modifier_type'] == '%' ? ($products_array['price'] * $o['price_modifier'] / 100) : $o['price_modifier'] ); }

To this
Code:
foreach($products_array['product_options'] as $o) { if($o['modifier_type'] != '%') $products_array['options_surcharge'] +=$o['price_modifier']; } foreach($products_array['product_options'] as $o) { if($o['modifier_type'] == '%') { $products_array['options_surcharge'] += ($products_array['options_surcharge'] * $o['price_modifier']) / 100; $products_array['options_surcharge'] += ($products_array['price'] * $o['price_modifier']) / 100; } }

The change I have made is instead of doing all the modifiers at once, it now does the absolute modifiers first, followed by price modifiers.
__________________
X-Cart version 4.3.0 <-- some sites I look after
X-Cart Version 4.4.0 < -- some other sites i look after
Reply With Quote
  #3  
Old 02-28-2011, 06:45 PM
 
minfinger minfinger is offline
 

X-Adept
  
Join Date: Apr 2009
Posts: 678
 

Default Re: Percentage Price Modifier to discount other price modifiers?

How do you work out payment for the remaining 50%?

Since my client is typically lists 1 product available per listing, this becomes a huge problem with the amount of traffic he gets. What I'm getting at is people who put an item (single item) in the cart and then don't complete the order. Often the item doesn't get released from their cart for a period of time. So he usually will list 5 as the quantity until the item is sold and then remove it from availability. Of course the quantity is remove from the product details and customers can only chose 1.

He'd like for the deposit to be taken and then for the item to be removed from inventory while the remaining amount due remains available for the customer to pay.

I find this rather perplexing myself. If an item is $1,000 and the deposit is $100, how do we make sure the customer can get back to pay the remaining $900? Also his deposits expire in 7 days, since his inventory is "live", literally alive, he must sell the item as fast as possible to make a profit.

Oh yeah, thanks for linking my thread. I've since gone a different route.
__________________
X-Cart 4.3
Joomla
Among other things
Reply With Quote
  #4  
Old 02-28-2011, 07:08 PM
 
minfinger minfinger is offline
 

X-Adept
  
Join Date: Apr 2009
Posts: 678
 

Default Re: Percentage Price Modifier to discount other price modifiers?

Vote for my suggestion

http://ideas.x-cart.com/forums/32109-x-cart-future-versions/suggestions/1542375-allow-deposits-on-products
__________________
X-Cart 4.3
Joomla
Among other things
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not 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 02:46 AM.

   

 
X-Cart forums © 2001-2020