Changin Add to Cart Button Position

  • Posts: 441
  • Thank you received: 24
11 years 7 months ago #140318

-- url of the page with the problem -- : www.lacestamagica.com
-- HikaShop version -- : 2.2.3
-- Joomla version -- : 3.2.1

I would like to change the add to cart button position in my show_tabular view
reading in the forum i copy/paste the following code:
<?php if(empty ($this->element->characteristics) || $this->params->get('characteristic_display')!='list'){ ?>
<div id="hikashop_product_quantity_main" class="hikashop_product_quantity_main">
<?php
$this->row = & $this->element;
$this->ajax = 'if(hikashopCheckChangeForm(\'item\',\'hikashop_product_form\')){ return hikashopModifyQuantity(\'' . $this->row->product_id . '\',field,1' . $form . ',\'cart\'); } else { return false; }';
$this->setLayout('quantity');
echo $this->loadTemplate();
?>
</div>

and paste it just after:
<span id="hikashop_product_price_main" class="hikashop_product_price_main">
<?php
if ($this->params->get('show_price')) {
$this->row = & $this->element;
$this->setLayout('listing_price');
echo $this->loadTemplate();
}
?>
</span>

It does not work at all, the result is broken template and not going to checkout.

Please Log in or Create an account to join the conversation.

  • Posts: 12953
  • Thank you received: 1778
11 years 7 months ago #140323

Hi,
Firstly can you show me how do you want to move your add to cart button through some screenshots ? so that I can give you some advice about how you should edit your "show_tabular" file.

Please Log in or Create an account to join the conversation.

  • Posts: 441
  • Thank you received: 24
11 years 7 months ago #140327

sure, here they are, first one as it is, second one as i would like it



Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 84242
  • Thank you received: 13686
  • MODERATOR
11 years 7 months ago #140367

For what you want to do, I would have given exactly the same modification advice.
So all I can think of is that you made a mistake when doing it.
Can you try again ?
What error do you get exactly ?
What is the resulting code exactly ? could you attach the file content in your message so that we can see your modification?

Please Log in or Create an account to join the conversation.

  • Posts: 441
  • Thank you received: 24
11 years 7 months ago #140387

Take a look at www.lacestamagica.cl in any product, if you click on the button it breaks the template like whe i have the cart in ajax.
i also uploaded the file

File Attachment:

File Name: h7752632.txt
File Size:12 KB

Attachments:
Last edit: 11 years 7 months ago by condorazul.

Please Log in or Create an account to join the conversation.

  • Posts: 84242
  • Thank you received: 13686
  • MODERATOR
11 years 7 months ago #140394

That's apparently because you have activated the option "Use AJAX when possible for add to cart buttons" of the configuration. Turn it back off as it is by default and it will work fine.

Please Log in or Create an account to join the conversation.

  • Posts: 441
  • Thank you received: 24
11 years 7 months ago #140396

it´s turned off

Last edit: 11 years 7 months ago by condorazul.

Please Log in or Create an account to join the conversation.

  • Posts: 84242
  • Thank you received: 13686
  • MODERATOR
11 years 7 months ago #140401

Ok, then before that code add the code:

<?php $this->formName = $form = ',0'; ?>
and that will force the AJAX mode off because with the modification you have, it is the AJAX mode which is currently used by the add to cart button.

Please Log in or Create an account to join the conversation.

  • Posts: 441
  • Thank you received: 24
11 years 7 months ago #140432

did not work either

Please Log in or Create an account to join the conversation.

  • Posts: 84242
  • Thank you received: 13686
  • MODERATOR
11 years 7 months ago #140440

Try instead:
<?php $this->formName = $form = ',\'hikashop_product_form\''; ?>

Please Log in or Create an account to join the conversation.

  • Posts: 441
  • Thank you received: 24
11 years 7 months ago #140446

Now it works!!!
Why does ajax not work in my template???

Please Log in or Create an account to join the conversation.

  • Posts: 84242
  • Thank you received: 13686
  • MODERATOR
11 years 7 months ago #140449

It cannot work when you have options on the products.

Please Log in or Create an account to join the conversation.

  • Posts: 441
  • Thank you received: 24
11 years 7 months ago #140459

I realised i have another problem, hikashop_product_price_with_options_main its not showing anything, the price is not displayed and not generated

Last edit: 11 years 7 months ago by condorazul.

Please Log in or Create an account to join the conversation.

  • Posts: 84242
  • Thank you received: 13686
  • MODERATOR
11 years 7 months ago #140477

It might be a problem with the chosen library. Turn it off in the Display tab of the configuration and that might help.

The following user(s) said Thank You: condorazul

Please Log in or Create an account to join the conversation.

  • Posts: 441
  • Thank you received: 24
11 years 7 months ago #140508

It Worked!!!! Thanks!

Please Log in or Create an account to join the conversation.

Time to create page: 0.100 seconds
Powered by Kunena Forum