Jump to content

where varables are set


peterp

Recommended Posts

Hi  All,

         This question will definately show my lack of knowledge about HTML, Smarty Template system and also cubecart, but anyway here goes.

I keep running into varibles in the HTML/PHP code that looks something like this "$NAVIGATION_TREE", "$CATEGORIES", "$LANG.navigation.saleitems" etc. these varibles obviously  have some code in them but I don't know where I can find this code.

I'm very confused about where these are setup or am I missing something altogether.

Can please somebody help me thankyou

 

Best Regards,

Peterp

Link to comment
Share on other sites

Hi peterp,

I'm using version 6.2.5.

The "$NAVIGATION_TREE$" smarty variable appears being assigned at line 1154 of file "classes/guiclasses.php".
See the preceding lines of code to see how the tree is populated and built though the getCategoryTree() and _makeTree methods.
This variable is then inserted {$NAVIGATION_TREE} at line 24 of skins/foundation/templates/box.navigation.php .

I would recommend that you install a software like grepWin, which let search easily amongts a whole directory (and its descendants) which file(s) contain some piece of code.
https://sourceforge.net/projects/grepwin/
and on the developer website: https://tools.stefankueng.com/grepWin.html

I'm new to the smarty template engine.
I start reading the documentation https://www.smarty.net/docs/en/index.tpl
From my current understanding of smarty, the templates are compiled and there are additional folders that I assume we don't have in the distribution, so that part of the programming logic can be hidden to us.

You can make Cubecart more chatty by enabling the debugging in "Dashboard > Settings > Advanced", "Performance" section.
You can also disable caching there to keep things more simple during customization.

Hope this helps.

Julien

Link to comment
Share on other sites

Hi Julien,

Thanks for you reply, however its just not the navigation I'm trying to modify but also what I;m trying to do is to modify the $SHOPPING_CART which in the skin that I'm using (eTrend) comes out as a single line and view cart, what I want to happen is the popup to appear as it does in the foundation skin. But I cannot modify the code as I cannot see where it is called very confusing.

If you can help I would appreciate it

Best Regards,

Peterp

Link to comment
Share on other sites

Incidentally, I'm working on a solution. It's slow-going at the moment -- too many distractions.

eTrend is a CC5 compatible skin. As such, it uses common javascript that CubeCart provides for all CC5 skins. In CubeCart's main folder, in the /js/common.js file, near line 375, there is a function that intercepts the Latest Products and Category panel's form's 'submit' action. The code then makes an AJAX call to add the product to the shopping basket.

The return from the AJAX call replaces the div#basket_summary -- essentially the entire template box.basket.php code.

Note that when constructing a page, the common elements of the page are built in the gui.class.php file. Near line 430 you will find $content containing the compiled template box.basket.php being assigned to the Smarty variable SHOPPING_CART.

The solution to be developed requires a modification to box.basket.php such that there is a new div block that is initially hidden, contains the $CONTENTS of the shopping basket, and gets triggered to being visible when some target is clicked or hovered.

So far, I have this:

Copy Foundation's template box.basket.content.php to eTrend's /templates/ folder.

Make the eTrend template box.basket.php look this:

<div id="basket_summary">
	<p>
		<span class="icon icon-basket"></span>
		<b>{$CART_TOTAL}</b>
		<a href="{$BUTTON.link}" title="{$BUTTON.text}" class="btn">{$BUTTON.text}</a>
		<div class="basket-detail-container hide" id="basket-detail">
			<div class="mini-basket-arrow"></div>
{include file='templates/box.basket.content.php'} 
		</div>
	</p>
</div>

Clear CubeCart's cache.

Additional tasks involve creating a CSS style to implement the hide class, identify a trigger, and write the javascript that runs when triggered to unhide the contents. Since this is a copy of Foundation's template, there will need to be some styling and layout edits.

I had thought to use the Superfish effects that one can see when hovering over the Shop by Category link in the Nav menu. That needs to be studied.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...