Jump to content

Problem with blockcart on hookTop


celestesaad

Recommended Posts

Hi everyone! I'm sorry if im posting on the wrong section here, this is my first topic on the forum. I was wondering if i could get any help with a problem I got after moving my blockcart module to the top Hook. I did a mix-up of modifications, first of all, I had to fix the extra "return;" on line 139 on the ajax-cart.js, which was blocking the cart from collapsing. Then I changed the cart to be expanded and collapsed by hovering it, as razaro showed on this topic: http://www.prestashop.com/forums/topic/51310-solved-block-cart-on-top/ . Up until here everything was fine, the cart collapsed great and the hover was working perfectly. But when I transplanted the module, after adding this to blockcart.php:

 

function hookTop($params)

{

return $this->hookRightColumn($params);

}

 

My cart started looking like this: http://i.imgur.com/XpYAr.jpg

 

I'm sure I missed something I else I had to change to make it work right. :(

Link to comment
Share on other sites

Hello,

 

The error is still there and as it is placed before the other scripts, this error prevents the execution of the following scripts.

 

$(document).ready(function() {
	    $('#slideshow').cycle({
		    fx: 'blindY' // choose your transition type, ex: fade, scrollUp, shuffle, etc...
	    });
    });

 

This section of the code uses jQuery, but jQuery is included after it, so it is not recognised and triggers the error.

Link to comment
Share on other sites

I commented that part yesterday, after I read your post. Lemme double check but Im pretty sure I replaced the files.

 

Edit: I hadn't, but I just did and again, nothing changed :(

 

Hello,

 

There's something wrong with the javascript file, I'm looking into it right now.

 

1. You have an extra error:

Error: $("#productscategory_list").serialScroll is not a function

Source File: http://www.coolsupertest.com.ar/modules/productscategory/productscategory.js

Line: 53

 

/js/jquery/jquery.serialScroll-1.2.2-min.js should be included before /modules/productscategory/productscategory.js

 

2. The html structure in the slideshow div is wrong, you're missing the <ul> tag

Link to comment
Share on other sites

Dwnloaded it directly from the author's website, right here: http://jquery.malsup.com/cycle/

 

As for the /js/, I didn't select the order in which the files are loaded, i think they're loaded in the header through this:

 

 

		{if isset($js_files)}

		{foreach from=$js_files item=js_uri}
		<script type="text/javascript" src="{$js_uri}"></script>
		{/foreach}
	{/if}

 

Im gonna fix that <ul> thing right now, see if that works out. Thank you so much for your help =)

Link to comment
Share on other sites

Actually, the ul is right there :( Here's the code:

 

<!-- MODULE Block new products -->
<div id="new-products_block_right" class="block products_block">
<h4><a href="{$link->getPageLink('new-products.php')}" title="{l s='New products' mod='blocknewproducts'}">{l s='New products' mod='blocknewproducts'}</a></h4>
<div class="block_content">
{if $new_products !== false}
 <ul class="product_images clearfix" id="slideshow">
	    {foreach from=$new_products item='product' name='newProducts'}
		    {if $smarty.foreach.newProducts.index < 3}
			    <li><a href="{$product.link}" title="{$product.legend|escape:html:'UTF-8'}"><img src="{$link->getImageLink($product.link_rewrite, $product.id_image, 'medium')}" height="{$mediumSize.height}" width="{$mediumSize.width}" alt="{$product.legend|escape:html:'UTF-8'}" /></a></li>
		    {/if}
	    {/foreach}
 </ul>
{else}
 <p>{l s='No new products at this time' mod='blocknewproducts'}</p>
{/if}
</div>
</div>
<br clear="all" />
<!-- /MODULE Block new products -->

Link to comment
Share on other sites

I didn't change anything regarding the ul :( Either way, I noticed that after friday, ajax is not working. Like, at all. My top menu doesn't work the way it should, and the right categories are not displayed once you enter into the view product section. what the hell? Chrome's console says:

 

Uncaught TypeError: Object [object Object] has no method 'serialScroll'
Uncaught TypeError: Object [object Object] has no method 'cycle'

 

 

These are the default files from prestashop, I haven't changed any of them. The only things I have changed are the .tpls inside the theme folder, and added some .js files. I don't understand how im suddenly getting errors on files I havent touched.

 

I've already replaced the packed version with the one you said :) It's still not working but i'm guessing it should be easier to debug it now, right?

Link to comment
Share on other sites

Hello,

 

The cycle works in Firefox now and no errors are displayed.

 

However your cart's expand/collapse is still not working....looks like the problem is with a Jquery selector, as the cart is not in the right nor left column.

 

My top menu doesn't work the way it should, and the right categories are not displayed once you enter into the view product section

Please explain.

Link to comment
Share on other sites

Yeah, i can see that its working great on FF, Safari, and IE9 & Chrome. Thank you!

 

EDIT: about the top menu, I just cleared my cache and it works fine, I'm guessing it was all related to that cycle thing. Thank you again. All I've got left is fixing that cart! yay!

Link to comment
Share on other sites

The cycle works in Chrome and IE9 too.

 

"comprar" which is "buy", you'll see that the product doesn't move smoothly to the cart section, but it actually reloads the whole page
Have you disabled the ajax cart?

 

 

It even had a nice sutil fade effect when coming in and out, but no more. As you can see on the first pic, it had rounded borders, and an arrow on the top link (category) on it's right to allow users to display it.
The menu doesn't have any style added to it, which would make it round.

The slide/grow effect works in FF, Chrom and IE9

Link to comment
Share on other sites

Ooook just a small problem now that I've tried to figure out for the past 2 hours...When a product is loaded in the cart and you try to delete it, you have to refresh the whole web page to see it reflected. When you click on delete, nothing happens until you refresh it.

Link to comment
Share on other sites

Did that just now. I've also added 'header_right' to each:

 

function(){
$(['left_column', 'right_column', 'header_right']).each(function(id, parentId)

 

What happens now is that it refreshes the page everytime you add a product and it takes you directly to checkout. It also says "undefined" when its loading the new page.

Link to comment
Share on other sites

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