Jump to content

Boxes in CubeCart v5?


Guest MCB Web Design
 Share

Recommended Posts

Guest MCB Web Design

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).

Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • 3 weeks later...
Guest beautyie

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....

Link to comment
Share on other sites

Guest MCB Web Design

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.

Link to comment
Share on other sites

Guest beautyie

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.

Link to comment
Share on other sites

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:

Link to comment
Share on other sites

  • 1 year later...

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
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.

 Share

×
×
  • Create New...