View Single Post
  #3  
Old 09-22-2014, 07:49 AM
  ecommweb's Avatar 
ecommweb ecommweb is offline
 

Advanced Member
  
Join Date: Nov 2008
Posts: 49
 

Default Re: xcart 5 additional charge

Thanks for the reply

I would agree that adding a surcharge would be preferable and I spent some time trying to get that to work, but after copying and editing that class accordingly I just couldn't figure it out (it didn't ever apply anything).

I have found I can use this (below) to get the currently selected Variant info, but could you provide any example as to how to get all other product variants for this order item?


PHP Code:
foreach ($this->getAttributeValues() as $v) {
                
$av $v->getAttributeValue();
                if (
$av->getAttribute()->isVariable($this->getProduct())) {
                    echo 
'<br/>'.  $av->getAttribute()->getName() . ': ' $av->asString();
                }
            } 


If I can get the non-ordered variants for this product here, I can compare them with the current $amount ordered and then selectively apply the additional charge.
__________________
www.ecommweb.co.uk
Custom X-Cart design and functions
eCommerce SEO

www.hubmaster.co.uk
Combine all your eCommerce channels in your existing website admin

+44 (0)1302 325 032
Reply With Quote