View Single Post
  #5  
Old 09-18-2012, 11:15 PM
  xplorer's Avatar 
xplorer xplorer is offline
 

X-Cart team
  
Join Date: Jul 2004
Posts: 925
 

Default Re: Overiding CDev Module css

First of all we search throuhg all the files for the widget class that adds the "product_details.css" file.

It is \XLite\Module\CDev\ProductOptions\View\Product. Here is it: https://github.com/litecommerce/core/blob/1.0-master/src/classes/XLite/Module/CDev/ProductOptions/View/Product.php

As you see the class "decorates" \XLite\View\Product\Details\Customer\ACustomer class. "Decoration" means that after the cache rebuild process there will be no ProductOptions\View\Product class anymore, but the changes will be included into the class being decorated. That's why if you want to "decorate" it further, you should extend the base \XLite\View\Product\Details\Customer\ACustomer class, not the ProductOptions\View\Product one.

So, we create a module, specify "Cdev\ProductOptions" in its dependencies, add a new class that decorates the \XLite\View\Product\Details\Customer\ACustomer class and declare getCSSFiles() method that parses the array returned by parent::getCSSFiles() and removes "product_class.css" from the list.
Reply With Quote