Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Recommended Posts

Posted

Hi i want to modify how the frontend Categories widget works

 

I thought id be able to extend the existing Categories widget class and override the pageName functions by creating a new file  (CategoriesNEW.php) containing :

 

namespace frontend\design\boxes;

use common\classes\design\boxes\categories

class CategoriesNEW extends Categories
{
    public static function pageName($categories_id, $countSubCategories)
    {
			//new code
    }
  
}

 

But it did not work... What is the best way to do this ? 

Posted

Sorry im new to this framework, I have looked at the wiki documentation but its not clear to me. 

 

Can you give me some step by step instructions on how to extend this class ?

 

Posted

Sorry i must have copied one of my earlier attempts. Lets try this again 

Im trying to override the run function in the frontend/design/boxes/Categories.php  

So i copy the the Categories.php to CategoriesNew.php and update the class to extend Categories 

namespace frontend\design\boxes;

use Yii;
use frontend\design\boxes\Categories;


class CategoriesNew extends Categories
{       
       
    public function run()
    {
        global $current_category_id, $breadcrumb;
		//Something New ......
    }
}

 

But it does not work,  

Should this work , or is this the wrong approach to modify existing widgets ?

 

 

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...