Guest MCB Web Design Posted September 11, 2011 Share Posted September 11, 2011 Yeah, can someone tell me where the controllers for boxes are in CubeCart v5? I have a client who was running CubeCart v4, I built a handful of custom boxes for them to use in templates (i.e. for Twitter feeds, a news module etc) but now can't for the life of me find them in CubeCart v5's file structure now that I'm converting the v4 template to work with v5 (thanks, CubeCart). Quote Link to comment Share on other sites More sharing options...
Homar Posted September 11, 2011 Share Posted September 11, 2011 Yeah, can someone tell me where the controllers for boxes are in CubeCart v5? I have a client who was running CubeCart v4, I built a handful of custom boxes for them to use in templates (i.e. for Twitter feeds, a news module etc) but now can't for the life of me find them in CubeCart v5's file structure now that I'm converting the v4 template to work with v5 (thanks, CubeCart). Do you just want to create a new sidebox (without any PHP code)? If so, you can just add the HTML into the main.php template file. Alternatively, you can create a new template file and include it into the main.php template file. See: http://www.smarty.net/docsv2/en/language.function.include.tpl Quote Link to comment Share on other sites More sharing options...
Guest MCB Web Design Posted September 11, 2011 Share Posted September 11, 2011 I'm wanting some PHP code to be executed, i.e. for the news module which pulls articles from a database table. Quote Link to comment Share on other sites More sharing options...
Homar Posted September 11, 2011 Share Posted September 11, 2011 I'm wanting some PHP code to be executed, i.e. for the news module which pulls articles from a database table. Look in the CubeCart class (classes/cubecart.php). Quote Link to comment Share on other sites More sharing options...
Guest beautyie Posted September 26, 2011 Share Posted September 26, 2011 Yeah, can someone tell me where the controllers for boxes are in CubeCart v5? I have a client who was running CubeCart v4, I built a handful of custom boxes for them to use in templates (i.e. for Twitter feeds, a news module etc) but now can't for the life of me find them in CubeCart v5's file structure now that I'm converting the v4 template to work with v5 (thanks, CubeCart). Did you ever get this worked out I have exactly the same issue and its driving me mad.... Quote Link to comment Share on other sites More sharing options...
Guest MCB Web Design Posted September 26, 2011 Share Posted September 26, 2011 Yeah, can someone tell me where the controllers for boxes are in CubeCart v5? I have a client who was running CubeCart v4, I built a handful of custom boxes for them to use in templates (i.e. for Twitter feeds, a news module etc) but now can't for the life of me find them in CubeCart v5's file structure now that I'm converting the v4 template to work with v5 (thanks, CubeCart). Did you ever get this worked out I have exactly the same issue and its driving me mad.... Sorry. I gave up and went with an alternative product. Life's too short to go trawling through the code-base of an ever-changing product that's documentation is almost non-existent. Quote Link to comment Share on other sites More sharing options...
Guest beautyie Posted September 26, 2011 Share Posted September 26, 2011 Yeah, can someone tell me where the controllers for boxes are in CubeCart v5? I have a client who was running CubeCart v4, I built a handful of custom boxes for them to use in templates (i.e. for Twitter feeds, a news module etc) but now can't for the life of me find them in CubeCart v5's file structure now that I'm converting the v4 template to work with v5 (thanks, CubeCart). Did you ever get this worked out I have exactly the same issue and its driving me mad.... Sorry. I gave up and went with an alternative product. Life's too short to go trawling through the code-base of an ever-changing product that's documentation is almost non-existent. thanks, I'm starting to feel the same way, what product did you go with. Quote Link to comment Share on other sites More sharing options...
Guest Posted September 27, 2011 Share Posted September 27, 2011 The individual boxes are created & populated in the /classes/gui.class.php file. It's a bit different than V4, but makes more sense if you're comfortable with OOP principals and ideas. :w00t: Quote Link to comment Share on other sites More sharing options...
themixtapechannel Posted December 10, 2012 Share Posted December 10, 2012 Hi, can anyone please give me a hint on how to create side boxes in V5. I'm totally going insane trying to create some side boxes on V5, they were so simple in V4. Thank you in advance for any advice. Quote Link to comment Share on other sites More sharing options...
bsmither Posted December 11, 2012 Share Posted December 11, 2012 I'll be happy to help. Start by looking at the HTML of a common box, the Sale Items list for example, by asking your browser to Show Source and you finding that block of code. Compare that with the template file, box.sale_items.php for example. Design your new box following the same format. Find the main.php template. The HTML here will have the names of the side boxes where they are to appear. Add yours to where you want it to appear. Call it {$MY_NEW_BOX}. Next, look in gui.class.php at the series of calls in the displayCommon() function (around line 280). This is the same as the list of boxes you are familiar with in CC4. You would add $this->_displayMyNewBox(); to this list. Next, you would move to the area of the gui class file that has all the private _display???() functions. They are in alphabetical order (thank you, Devellion!), so find where to insert: private function _displayMyNewBox() { ... } The final steps are to: * Make any needed determinations (logged-in user, etc) * Fetch whatever data you need from the database (based on those considerations) * Manage the data (make further calculations, add more, delete some, etc) * Assign the data to the Smarty variables you used in your template * Have Smarty fetch the template of your new box and Smarty will render/populate it * Assign the rendered HTML to the Smarty variable 'MY_NEW_BOX'. As to how to use the Smarty template language when creating your template, Smarty has sufficient differences to the XTemplate system you are familiar with in CC4 to cause some minor headaches. You need to drop the <!-- BEGIN/END: block_name --> syntax used by XTemplate. Smarty expects conditional flags to be set in the function, then the template will contain program flow and condition statements to test against those flags. Send me a Private Message with your email address if you want/need more personal exercises in CC5's programming paradigm. Quote Link to comment Share on other sites More sharing options...
themixtapechannel Posted December 11, 2012 Share Posted December 11, 2012 Hey bsmither, Thank you very much for your help and info. I tell you honestly, it sounds chinese with so much to do for just a simple side box lol.... But I will give it a shot tomorrow and see if I can get bypass these sideboxs since I'm just looking to add some RSS links and image on them, nothing major. I thank you again buddy. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.