Jump to content

Tutorial: Move Blockcart to left/rightColumn (1.5)


CrossY

Recommended Posts

As i've just spent half a lifetime on getting this to work, a quick runthrough on how to (re)move your header blockcart, and add it to left or rightColumn (menu).

  1. Open global.css
  2. Add the lines:
    								#shopping_cart {
    									visibility: hidden;
    								}


    to the bottom of your file****. This removes the visibility of the Blockcart at the top of the page, but keeps the margins so that you don't have to fix your layout.

  3. Open /modules/blockcart/blockcart.php
  4. Edit line 164 from:
    || $this->registerHook('top') == false

    to:

    || $this->registerHook('right') == false


    PERHAPS you might need to change 'right' to 'left' for leftcolumns. I'm not 100% sure this step is even required. Have I said i'm a beginner yet? ;)
     
     
    Now the image still flies to the top right corner, we fix this in (open file:) /modules/blockcart/ajax-cart.js

  5. Change line 219 to:
    if ($('#right_column #cart_block').offset().top && $('#right_column #cart_block').offset().left)
    							var cartBlockOffset = $('#right_column #cart_block').offset();


    Change "right_column" to "left_column" if desired.

  6. To fix a bug where the cart disappears entirely when you remove an item from the cart, change (in ajax-cart.js) line 311, from:
    $("#cart_block").stop(true, true).slideUp(200);

    to:

    $("#header #cart_block").stop(true, true).slideUp(200);


  7. Make sure you enable ALL of the following hooks of "blockcart" in your BO:
    TopOfPages
    Header of Pages
    RightColumn or LeftColumn
  8. Save/upload files n shit, refresh browser and all that

 

* I'm a beginner, so I probably won't be able to answer any support questions

** Some of this code comes from other parts of this forum, credits to them (can't find your names anymore)

*** Worked for version 1.5.3, not tested on any other code

**** Blockcart is 'hardcoded' into the theme, so you can't unhook it like other modules.. hence this work-around.

 

Goodluck!

Edited by CrossY (see edit history)
  • Like 1
Link to comment
Share on other sites

  • 5 weeks later...

Version 1.5.5 -- Moving ajax image to right column cart (line 222):

				if ($('#right_column #cart_block')[0] && $('#right_column #cart_block').offset().top && $('#right_column #cart_block').offset().left)
					var cartBlockOffset = $('#right_column #cart_block').offset();
				else
					var cartBlockOffset = $('#right_column #shopping_cart').offset();
Edited by CrossY (see edit history)
Link to comment
Share on other sites

using version 1.5.5 and using default skin.

 

I'm used to following these kind of cut and paste directions.

 

Unfortunately, no luck.  Bummer ... really wanted it to move to the right column. :(

 

oh, and I checked the hooks in the Back Office for the 'blockcart' and two were enabled,

TopofPages

Header of Pages

 

no such hook available for RightColumn or Left Column

Edited by surferboy (see edit history)
Link to comment
Share on other sites

ummm, you'll have to explain a little what you mean by hooking it to the right column in the Back Office.

 

I know in Back Office to look for Modules -> Positions   and I kind of made the logical deduction that if there is a module or hook present and I don't want it there, (for a given module), then I click on the checkbox and then click the unhook button.

 

Beyond that, I'm not sure what you mean ...

 

Thanks for trying to explain.

 

Brian

Link to comment
Share on other sites

Rather than deleting modules, you can add them as well. You may have to do that for your shop (see step 7 of my original post).

 

To do this, go to: Modules -> Positions -> Select "Shoppingcart" -> Position a Module -> hook into "DisplayRightColumn (Right column blocks)".

 

I found this video which explains it. It's an old Prestashop version, but the idea is pretty much the same: http://www.youtube.com/watch?v=0Af-oEToNYk

Edited by CrossY (see edit history)
Link to comment
Share on other sites

Hey,

 

Thanks for the vid link. that was helpful although I guess they got rid of some of the simpler, user-friendly stuff.  So I did go to Modules -> Positions -> Cart Block (assume that's what you meant) -> Transplant a Module -> and the Cart Block appears in the Module field and then I selected the displayRightColumn and hit save. 

 

Cool, it appears but the My Account block (which I have moved to the right column as well and then dragged up to just below the cart block) makes it disappear every time I slide my mouse over the My Account block ... very weird.

 

Is that the ajax-js issue?

 

[EDIT: so I did not have the Top Of Pages module "hooked" in for Cart Block.  Once I did that, it stopped disappearing.

 

Just huge thanks for helping me through the door.  But ... all the code changes you did in your original post ... only the hide visibility change in the global.css file was necessary. Everything else was accomplished through just the hooking of modules.]

 

Really appreciate your taking the time to help.

 

Brian

Edited by surferboy (see edit history)
Link to comment
Share on other sites

Sorry, some of my instructions may be off a bit because my BO is in Dutch ;)

 

The disappearing thing solves itself when you follow all steps, i'm not quite sure which step is responsible for fixing it*. I've had the same thing happening, so it's possible to fix.

 

*I believe it comes from an error where the rightblock starts to behave in a similar way as the top-cart (appear/disappearing  on mouse hover)

Link to comment
Share on other sites

  • 5 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...