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

Adding calculated fields to the Product Admin Area

 
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)
 
Thread Tools Search this Thread
  #1  
Old 04-05-2015, 07:49 AM
 
minfinger minfinger is offline
 

X-Adept
  
Join Date: Apr 2009
Posts: 678
 

Default Adding calculated fields to the Product Admin Area

I'd like to add the following fields to the product admin area. And I want them to calculate base on the Sale price, they should not be editable. How do I do that?
http://i21.photobucket.com/albums/b298/fasterthanyours/Admin%20-%20Deposit%20Info.jpg
__________________
X-Cart 4.3
Joomla
Among other things
Reply With Quote
  #2  
Old 04-05-2015, 12:59 PM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,190
 

Default Re: Adding calculated fields to the Product Admin Area

Possible, not so hard to do. I have done similar for XC5 module.
You can contact me with details.
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote

The following user thanks cflsystems for this useful post:
tony_sologubov (04-09-2015)
  #3  
Old 04-11-2015, 02:07 PM
 
minfinger minfinger is offline
 

X-Adept
  
Join Date: Apr 2009
Posts: 678
 

Default Re: Adding calculated fields to the Product Admin Area

Those are the details. How do I make a field that shows 25% of the Price field and another that shows 75% of the Price field?
__________________
X-Cart 4.3
Joomla
Among other things
Reply With Quote
  #4  
Old 04-16-2015, 05:11 AM
  tony_sologubov's Avatar 
tony_sologubov tony_sologubov is offline
 

X-Cart team
  
Join Date: Jan 2009
Posts: 2,431
 

Default Re: Adding calculated fields to the Product Admin Area

Actually, I do not see a problem here. Just create new properties in Product model and define their values as you need.
__________________
Found a bug in X-Cart? Post it to our bug tracker!
Know how to make X-Cart better? Suggest an idea!
Reply With Quote
  #5  
Old 04-19-2015, 06:46 AM
 
minfinger minfinger is offline
 

X-Adept
  
Join Date: Apr 2009
Posts: 678
 

Default Re: Adding calculated fields to the Product Admin Area

Remember I'm green as heck on this stuff. How do I do that?
__________________
X-Cart 4.3
Joomla
Among other things
Reply With Quote
  #6  
Old 04-19-2015, 08:46 PM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

X-Guru
  
Join Date: Dec 2010
Posts: 6,373
 

Default Re: Adding calculated fields to the Product Admin Area

Hello,

\XLite\View\Model\Product::$schemaDefault is the array that defines fields for the Edit Product form. You should decorate this class from your module and add your custom fields from the constructor method.

\XLite\View\Model\Product::getDefaultFieldValue() is the method that returns the default value for a form field. So, you should decorate this method and make it return the product price multiplied by your values for the custom fields.

However, if your goal is not learning how to code for X-Cart 5, it makes sense to hire someone who could customize it for you
__________________
Alex Solovev,
Qualiteam

---

User manual Video tutorials X-Cart FAQ

You are welcome to press "Thanks" button
if you find this post useful

Click here to learn how to apply patches

X-Cart Extensions
Reply With Quote
  #7  
Old 04-30-2015, 03:41 AM
  tony_sologubov's Avatar 
tony_sologubov tony_sologubov is offline
 

X-Cart team
  
Join Date: Jan 2009
Posts: 2,431
 

Default Re: Adding calculated fields to the Product Admin Area

The article might be helpful as well:
http://kb.x-cart.com/display/XDD/Adding+new+property+to+a+product
__________________
Found a bug in X-Cart? Post it to our bug tracker!
Know how to make X-Cart better? Suggest an idea!
Reply With Quote
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)



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 06:23 PM.

   

 
X-Cart forums © 2001-2020