Add text below add to cart button

  • Posts: 40
  • Thank you received: 0
11 years 9 months ago #135519

Hi

I would like to add some text below all my products' add to cart buttons. It would read something like this, "Shipping only available in this region". Is this possible?

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

  • Posts: 84304
  • Thank you received: 13698
  • MODERATOR
11 years 9 months ago #135543

You can edit the file "quantity" via Display->Views and add your text at the end.

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

  • Posts: 40
  • Thank you received: 0
11 years 9 months ago #135834

Thanks nicolas! After a bit of tinkering I figured it out. I made a div right before the very last <?php
}elseif
. Great reply.

Last edit: 11 years 9 months ago by dar3d3vil.

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

  • Posts: 40
  • Thank you received: 0
11 years 9 months ago #136093

Now that I have successfully added the text, I was wondering if there was some way to hide it when it appears in the module.

I mean, it looks great on the product page but there is a lot of text (about 20 words). So when the product shows up in the homepage module, the text after the add to cart button just runs all over. Can I just hide this text for the module and keep the 'add to cart' button?

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

  • Posts: 84304
  • Thank you received: 13698
  • MODERATOR
11 years 9 months ago #136132

Then instead of adding your text in the quantity view file, you can add it in the show_default view file, just after the loading of the quantity view file. That way, it will only display in the product page.

Last edit: 11 years 9 months ago by nicolas.

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

  • Posts: 40
  • Thank you received: 0
11 years 8 months ago #136340

Awesome. That worked like a charm.

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

  • Posts: 272
  • Thank you received: 7
11 years 4 months ago #155171

Hi there,

Similar question... which view would I need to edit in order to add some text right below the "add to cart" button on the product page... (image attached). There is a big bit of empty white space which I would like to make use of.

Thanks in advance

Attachments:

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

  • Posts: 84304
  • Thank you received: 13698
  • MODERATOR
11 years 4 months ago #155207

Hi,

You want to edit the file "quantity" of the view "product" and add your text at the end.

The following user(s) said Thank You: boopoo

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

  • Posts: 272
  • Thank you received: 7
11 years 4 months ago #155413

Hi Nicolas,

Would there be any way to add it just to one category, rather than to every single product page in the shop?

Thanks inadvance

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

  • Posts: 84304
  • Thank you received: 13698
  • MODERATOR
11 years 4 months ago #155426

Hi,

Yes.
In the view you can add such code:

<?php
if($this->categories[0]->category_id==XXX)
echo 'YYY';
?>
where XXX is the id of the category and YYY is the custom text that you want to display.

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

  • Posts: 272
  • Thank you received: 7
11 years 3 months ago #155525

That's great. All the best Nicolas

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

  • Posts: 47
  • Thank you received: 4
10 years 8 months ago #183224

Thanks nicolas

this is an excellent modification

i was just wondering if it can be modified to include multiple categories

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

  • Posts: 84304
  • Thank you received: 13698
  • MODERATOR
10 years 8 months ago #183228

No need to modify it.
Just copy/paste the code several times and change the XXX and YYY in each piece of code.

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

  • Posts: 47
  • Thank you received: 4
10 years 8 months ago #183314

thanks for your time - i agree that this would work.

problem is that my client has 138 categories (about 2/3rds of them will have the same info) and i was hoping there would be a more efficient method - im not very good with php so i was just wondering if there was a method to input multiple id's?

sounds like there may not be?

thanks again for your time and your excellent product!
;-)

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

  • Posts: 13201
  • Thank you received: 2322
10 years 8 months ago #183328

Hi,

You can use this kind of code:

<?php
$categoriesA = array('XXX','XXY','XXZ');
if(in_array($this->categories[0]->category_id,$categoriesA))
    echo 'YYY';
?>

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

  • Posts: 47
  • Thank you received: 4
10 years 8 months ago #183425

this has been an excellent help - thanks very much for your time

;-)

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

Time to create page: 0.083 seconds
Powered by Kunena Forum