Post by pee » Fri May 22, 2009 6:46 pm

Hi,

I've done some changes in the product.tpl. When I'm clicking on the add to cart-button, so the product-images does this beautiful sliding-effect, but then there isn't displayed the price, article-name and the quantity - in the left part of the page.

My form for the adding-to cart look so:

Code: Select all

 <form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data" id="product">        
  <input type="text" name="quantity" size="3" value="1" />  		
 <a onclick="$('#product').submit();" id="add_to_cart" class="button"><span><?php echo $button_add_to_cart; ?></span></a></div>
            <input type="hidden" name="product_id" value="<?php echo $product_id; ?>" />
	</form>
Which values is OC expecting from the product.tpl for good work of the cart?

Professionelles Onlineshop-Design & -Programmierung: http://netzor.de


User avatar
pee
New member

Posts

Joined
Fri May 08, 2009 4:48 pm
Location - Germany

Post by halalan » Sat May 23, 2009 8:28 pm

Which version are you using. v 1.2.8 had an issue with not displaying the product amount properly unless you refreshed the page, a code fix was posted and its supposed to be corrected in the next release!

As discussed earlier:
phpuk wrote:Hi halalan,

AJAX Script update:

Script: catalog/view/theme/default/template/module/cart.tpl

The current fix is:

Code: Select all

$(document).ready(function () {
   $('#add_to_cart').replaceWith('<a onclick="" id="add_to_cart" class="button">' + $('#add_to_cart').html() + '</a>');

   $('#add_to_cart').click(function () {
      $.ajax({
         type: 'post',
         url: 'index.php?route=checkout/cart',
       data: $('#product :input'),
         success: function(){
         $('#module_cart .middle').load('index.php?route=module/cart/callback');
         }
      });

      var image = $('#image').offset();
      var cart  = $('#module_cart').offset();

      $('#image').before('<img src="' + $('#image').attr('src') + '" id="temp" style="position: absolute; top: ' + image.top + 'px; left: ' + image.left + 'px;" />');

      params = {
         top : cart.top + 'px',
         left : cart.left + 'px',
         opacity : 0.0,
         width : $('#module_cart').width(),
         heigth : $('#module_cart').height()
      };

      $('#temp').animate(params, 'slow', false, function () {
         $('#temp').remove();
      });
   });
});
This however has not been acknowledged by Daniel as the final solution as is therefore simply an option at the moment.

With the speed of development at the moment release candidates would not be very beneficial. Daniel updates the version number so that should be enough for now. You should view them all as BETA release candidates although the product is stable.

A version number displayed in the Admin section would be useful though.

Phil.

Helping Each Other With Knowledge....
WHPOA.NET CTOA.NET CEMETERYTN.COM


User avatar
New member

Posts

Joined
Sat Mar 28, 2009 3:13 am
Location - U.S.A.

Post by BDKR » Sat May 30, 2009 12:36 pm

Thanx for the post halalan. Just what I needed. ;D

Newbie

Posts

Joined
Tue May 26, 2009 7:33 am

Post by pee » Sun Jun 14, 2009 7:11 am

This solution is only working for the first product. When I want to add a second product in the cart, so there is no effect. Only the ajax-sliding effect works.

Has anybody an idea? :-\

Professionelles Onlineshop-Design & -Programmierung: http://netzor.de


User avatar
pee
New member

Posts

Joined
Fri May 08, 2009 4:48 pm
Location - Germany

Post by phpuk » Sun Jun 14, 2009 8:06 am

This fix works for everyone else that has used it.

You seem to alter lots of things in the code and then post a question saying that something doesn't work?

Do you backup your code before you do changes and when you come across a problem go back and test to see if the problem exists in your backup?

Just a question and proposed development test cycle.

Phil.

Global Moderator

Posts

Joined
Wed Mar 25, 2009 10:57 am

Post by pee » Sun Jun 14, 2009 8:49 am

Ok ok, the fix worked at first. But then a byte-code-error was on the file. I've removed it in VIM with »:set nobomb«. Now everything works. O0

Thanks for your solution and help!

Professionelles Onlineshop-Design & -Programmierung: http://netzor.de


User avatar
pee
New member

Posts

Joined
Fri May 08, 2009 4:48 pm
Location - Germany
Who is online

Users browsing this forum: No registered users and 4 guests