Jump to content

Resolved - Shopping Cart Pages Not Loading Shopping Cart Box


Nikki72

Recommended Posts

I'm still trying to convert my V4 skin over to V5 and on my V4 skin i have 3 tabs at the top which each include currency, search and shopping cart boxes. While i've got this working on my V5 template i've just realised that when you go through the checkout pages, the shopping cart box doesn't show up which then brakes my template layout.

In V3 and V4 you just needed to edit the cart.php file to add or remove boxes that show up on the cart pages but i can't seem to find the same php file in V5. I've obviously already edited main.php!

Can anyone tell me which file i need to edit to add the shopping cart box reference so it shows up throughout the checkout pages please?

Link to comment
Share on other sites

I'm not sure if this will help or not, but the main.php should have something similar to this in it, except changed from sidebar_right to header or whatever you designated as the top bar:


<div class="sidebar" id="sidebar_right">

	{$SESSION}

  {$SHOPPING_CART}

  {$RANDOM_PROD}

  <div id="language_currency">

	{$LANGUAGE}

	{$CURRENCY}

  </div>

  {$MAIL_LIST}

   </div>

Anytime you need to see what the default code is you can always look at the Vanilla skin, or if you've modified that one - one of the other default skins.

Link to comment
Share on other sites

I'm not sure if this will help or not, but the main.php should have something similar to this in it, except changed from sidebar_right to header or whatever you designated as the top bar:


<div class="sidebar" id="sidebar_right">

	{$SESSION}

  {$SHOPPING_CART}

  {$RANDOM_PROD}

  <div id="language_currency">

	{$LANGUAGE}

	{$CURRENCY}

  </div>

  {$MAIL_LIST}

   </div>

Anytime you need to see what the default code is you can always look at the Vanilla skin, or if you've modified that one - one of the other default skins.

Thanks for replying but as i said, id already done that. There must be a core php file somewhere governing which boxes appear on the cart pages, just as there was in v3 and v4 :)

Link to comment
Share on other sites

I figured that was too easy. Maybe gui.class.php?

If you haven't already, try here in the 3rd party forum.

http://www.cubecartf...-breakdown.html

This thread probably belongs on the 3rd party forum, anyway.

Thanks for that. I'm going through gui.class.php but still don't understand why {$SHOPPING_CART} doesn't show up on the cart pages. The code doesn't seem as obvious as it did with v3 and v4 lol.

Link to comment
Share on other sites

The 'cart' pages are now using the same main template as the 'index' pages as seen in CC3/4. There is no more having a different template (even if it looks essentially the same) when going through the checkout steps.

* Most of the "boxes" are populated by code found in the "Private" section of the GUI class: _displayWhatever. (The basket needs to be public.) (Let's call this the controller.)

* Most of the "boxes" templates are found in skin files that begin with box. (Let's call this the view.)

So, for the shopping basket contents view (shows the items added to cart while shopping), the template is box.basket.php, but the controller is eventually arrived at by first determining if it should be displayed (show the basket during checkout?) at GUI::displayCommon(). If we are not at these steps: basket, cart, complete, checkout, confirm, or gateway, then we displaySideBasket().

Link to comment
Share on other sites

The 'cart' pages are now using the same main template as the 'index' pages as seen in CC3/4. There is no more having a different template (even if it looks essentially the same) when going through the checkout steps.

* Most of the "boxes" are populated by code found in the "Private" section of the GUI class: _displayWhatever. (The basket needs to be public.) (Let's call this the controller.)

* Most of the "boxes" templates are found in skin files that begin with box. (Let's call this the view.)

So, for the shopping basket contents view (shows the items added to cart while shopping), the template is box.basket.php, but the controller is eventually arrived at by first determining if it should be displayed (show the basket during checkout?) at GUI::displayCommon(). If we are not at these steps: basket, cart, complete, checkout, confirm, or gateway, then we displaySideBasket().

Thanks so much for your reply. Yes i've found those such as:

* Display random products box */

but I can't seem to find one for the shopping cart box.

Link to comment
Share on other sites

Is this what you need?

lines 269-280 in my gui.class.php


  * Display common GUI parts like the boxes

  */

public function displayCommon($admin = false) {

  if (!$admin) {

   if (!isset($_GET['_a']) || $_GET['_a'] != 'template') {

    $this->_displayLanguageSwitch();

    $this->_displayCurrencySwitch();

    $this->_displaySessionBox();

    if(!in_array($_GET['_a'],array('basket','cart','complete','checkout','confirm','gateway')) && !$GLOBALS['config']->get('config', 'catalogue_mode')) {

	 $this->displaySideBasket();

    }

   }

Link to comment
Share on other sites

Is this what you need?

lines 269-280 in my gui.class.php


  * Display common GUI parts like the boxes

  */

public function displayCommon($admin = false) {

  if (!$admin) {

   if (!isset($_GET['_a']) || $_GET['_a'] != 'template') {

	$this->_displayLanguageSwitch();

	$this->_displayCurrencySwitch();

	$this->_displaySessionBox();

	if(!in_array($_GET['_a'],array('basket','cart','complete','checkout','confirm','gateway')) && !$GLOBALS['config']->get('config', 'catalogue_mode')) {

	 $this->displaySideBasket();

	}

   }

Yes i see that aswell as

$this->_displayNavigation();

$this->_displaySearchBox();

$this->_displaySaleItems();

$this->_displayMailingList();

$this->_displayDocuments();

$this->_displayRandomProduct();

$this->_displayPopularProducts();

$this->_displaySkinSelect();

But none of this references the shopping basket box. I've tried adding

$this->_displayShoppingBasket();

and:

$this->_displayBasket();

to no avail. :wacko:

Link to comment
Share on other sites

In the GUI class, you are looking for code that begins with:


	/**

	 * Display / Generate Side Basket

	 *

	 * @return string/bool

	 */

	public function displaySideBasket() {



		// Display the basket sidebar





It builds all the HTML that will be shown in the shopping basket box and assigns that HTML to $content. $content is then assigned to SHOPPING_CART.



Please realize that "Side Basket" is badly named, but it is the shopping basket box.



Also realize that if the web address shows:

store.com/?_a=basket (or cart, complete, checkout, confirm, gateway), Devellion has decided CC5 is to not show the "side basket" (same as in CC3/4).



If you really want to show the "side basket" box for these pages, change:



if(!in_array($_GET['_a'],array('basket','cart','complete','checkout','confirm','gateway')) && !$GLOBALS['config']->get('config', 'catalogue_mode')) {



to:



if(!$GLOBALS['config']->get('config', 'catalogue_mode')) {

That should get you the box no matter what (unless in "Catalogue-Only" mode).

If the absence of this box messes up your layout, then, in my opinion, we need to study what to do about the skin and the skin's CSS rather than forcing the presence of this box.

Link to comment
Share on other sites

In the GUI class, you are looking for code that begins with:


	/**

	 * Display / Generate Side Basket

	 *

	 * @return string/bool

	 */

	public function displaySideBasket() {



		// Display the basket sidebar





It builds all the HTML that will be shown in the shopping basket box and assigns that HTML to $content. $content is then assigned to SHOPPING_CART.



Please realize that "Side Basket" is badly named, but it is the shopping basket box.



Also realize that if the web address shows:

store.com/?_a=basket (or cart, complete, checkout, confirm, gateway), Devellion has decided CC5 is to not show the "side basket" (same as in CC3/4).



If you really want to show the "side basket" box for these pages, change:



if(!in_array($_GET['_a'],array('basket','cart','complete','checkout','confirm','gateway')) && !$GLOBALS['config']->get('config', 'catalogue_mode')) {



to:



if(!$GLOBALS['config']->get('config', 'catalogue_mode')) {

That should get you the box no matter what (unless in "Catalogue-Only" mode).

If the absence of this box messes up your layout, then, in my opinion, we need to study what to do about the skin and the skin's CSS rather than forcing the presence of this box.

Sorry for the late reply, it's been a hell of a day. Bloody kids! lol

Last night i actually added

$this->displaySideBasket();

to:

$this->_displayNavigation();

$this->_displaySearchBox();

$this->_displaySaleItems();

$this->_displayMailingList();

$this->_displayDocuments();

$this->_displayRandomProduct();

$this->_displayPopularProducts();

$this->_displaySkinSelect();

which works perfectly. Is there a problem i'm going to run in to doing it this way over the way you've suggested above?

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.

×
×
  • Create New...