Add to card html link adjustment

  • Posts: 98
  • Thank you received: 12
1 year 11 months ago #340520

Hi there,

for the product order you can add a simple link to stock pages with “Add to card html link”. The problem here is that neither an order quantity nor product variants can be selected.

Is it possible to further develop the content of this "Add to card html link" function?

We would like to integrate the shop afterwards, here it would be easiest to add the order area with the necessary selection options to the existing product pages.

Thank you for the support in advance.

Christian sends greetings

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

  • Posts: 81361
  • Thank you received: 13037
  • MODERATOR
1 year 11 months ago #340521

Hi,

The add to cart HTML link can't easily be modified to support all that.

What you can do is this instead:
- access the normal product page of a product on your frontend. There, add the parameter ?tmpl=component to the URL in your browser address bar. You'll see that you'll get a page with the product details area without your template and the modules around.
So you can use that URL as the source of an iframe where you want to add that:
www.tutorialrepublic.com/html-tutorial/html-iframes.php
- If you want to remove some parts of the product details area (for the example the image on the left), you can edit the file show_default, via the menu Display>Views and just remove the parts of the code you don't need. You can see nice HTML comments around each area so you can easily know what to remove. There is also a drag & drop interface to move the blocks around and remove the ones you don't want without even knowing anything about coding. That way, you could leave only the characteristic / options selectors and the quantity ipnut and add to cart buttons and remove the parts you don't need.

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

  • Posts: 98
  • Thank you received: 12
1 year 11 months ago #340585

Hi,

thank you for the feedback.

I have created an extra field for the products, here in the product area (back-end) further information is recorded that does not fit into the conventional product fields. I would like to include (display) this field in the front-end, how can I include the additional field I created here in the view builder?

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

  • Posts: 81361
  • Thank you received: 13037
  • MODERATOR
1 year 11 months ago #340589

Hi,

In the settings of the custom fields, you have a display option to display the custom field on the product details page on the frontend.
So if that setting is turned on, and that you entered something in that custom field for a product, the custom field will be displayed automatically in the "specifications" area that you can see in your view builder for the show_default view file.

Now if you want to manually display a custom field outside that specifications area, it's possible with a bit of code:
www.hikashop.com/forum/product-category-...om-field.html#250665

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

  • Posts: 98
  • Thank you received: 12
1 year 11 months ago #340980

Hello Nicolas,

thanks for the help, that workes fine.

Another question: How about an update? Will these changes be overwritten again in show_default?

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

  • Posts: 81361
  • Thank you received: 13037
  • MODERATOR
1 year 11 months ago #340981

Hi,

You won't loose your changes. However, you won't get the potential modifications we'll add to the view file in the future. So for example, when PHP 9 is released and your hosting moves your website to it, if it has changes that breaks the code you have in that view file override, then even if you update HikaShop, you won't get the modifications in your view file override.
So in that case, you'll have to redo the changes to the new version of the view file.
So make sure you clearly write somewhere what you changed where so that the day you need to redo the view override, you can easily do it.

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

Time to create page: 0.057 seconds
Powered by Kunena Forum