General question about product

  • Posts: 1119
  • Thank you received: 114
5 years 10 months ago #303394

Hi,

We have 1 product which is set of 2 products. As example for better understanding lets call it. Pants and t-shirts.
Those pants and t-shirts are on sale seperatly too. So basicly we have 3 products on sale.

In the product page which is set of the product we would like to show pants and t-shirts in the list and allow to chose size for each of product option. I am not sure how to explane it well so take a look to the screenshot.


The customization it's self is fine i am just struggling to understand how this can be done with hikashop.

Thanks

Attachments:

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

  • Posts: 83041
  • Thank you received: 13405
  • MODERATOR
5 years 10 months ago #303405

Hi,

How about using the "options" feature:
www.hikashop.com/support/documentation/i...ct-form.html#options
You would have 3 products:
- the "product 2" with a characteristic "size" with a variant for each size available for that product.
- the "product 3" with a characteristic "size" with a variant for each size available for that product.
- the product set" with both product 2 and product 3 added as options.
That way, you would get a product page with one dropdown for product 2 for the size selection and one for product 3 for ths size selection, the total with options and the add to cart button.

Then, it's just some customization to add the product 2 and product 3 images and some CSS to make it look like on your screenshot.

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

  • Posts: 1119
  • Thank you received: 114
5 years 10 months ago #303420

Hi,

I have played with options and see 2 issues.

1. Issue with price it self.

Product set has price 40 euros.
Product 2 has price 20 euros
Product 3 has price 20 euros.

When you add to cart the price is 80 euros but it should be 40 euros only. So tried to remove price from product set but then it's a free product those not visible on product listing. If i set to show free product then this product has no price. How should i have price for it too?

2. After adding product set to cart, the cart shows as one product is added to cart with some options. I expect here 2 products should be added to cart ( product 2 and product 3 ). I think i could create custom view and use it only for such products but not sure how should i trigger add to cart only for these products and NOT product set? Is there somekinda html i could use? Also not sure about notify pluging behiviour here too?

Thanks for help.

Kind Regards

Last edit: 5 years 10 months ago by kyratn.

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

  • Posts: 83041
  • Thank you received: 13405
  • MODERATOR
5 years 10 months ago #303426

Hi,

1. Well, you can use a translation override to remove the "free" text. But why not do the opposite and remove the price from product 2 and product 3 and leave the product set price at 40 ?
You could move these product 2 and product 3 products in an unpublished category so that customers wouldn't be able to purchase them for free.

2. If you want the product 2 and 3 to show as separate products, then you can turn off the "group options with product" setting of the HikaShop configuration. However, if you do that, you won't want to do what I just proposed in point 1 as otherwise the products would show as free in the cart.

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

  • Posts: 1119
  • Thank you received: 114
5 years 10 months ago #303471

Hi,

1. Hmm... The main idea is to have 3 products on sale. Product set will have different layout. It will show as product set with different options, and when adding it to cart it should add those 2 options only. The issue here is the price on product listing. So i think i will have to check if product has options on product listing page and change price there....

2. I have turned off the "group options with product" but it adds 3 products to cart. I would like not to add "product set" product to cart if that's possible?


3. I think easiest way would be to have custom add to cart button which would add only these product options to cart. And that's not the problem. The problem is that how can i add those product options and trigger popup which will show that product set is added to cart?

Thanks

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

  • Posts: 83041
  • Thank you received: 13405
  • MODERATOR
5 years 10 months ago #303480

Hi,

2. There is no option to not have the product set appear in the cart when adding it to the cart.
If you try to create a plugin to catch the add to cart and refuse the add to cart of the product, it will remove its options automatically.
So you would have to create something more complex which would add the options as normal products at that point.
It feels like this is starting to be impractical.

3. Indeed, It would be easier to make your own add to cart button and generate the add to cart URL link dynamically based on the value selected in the two dropdowns. With a bit of JS it should be possible. You can see an example of what parameters should be used by activating the add to cart buttons on a listing of products without variants and setting the "add toc art on listing" setting to "global" as that will give you one add to cart button with several quantity input fields, one per product to be able to add several products at once in the cart.

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

  • Posts: 1119
  • Thank you received: 114
5 years 10 months ago #303503

Hi,

Thanks for help Nicolas. I have done as per you suggestion and now i understand how it works. However i came across to the issue and not sure what could be done here.

The product page it self is in the form tag with the name attribute. The form tag comes from product->show.php file and cannot be modified. We do modification in custom file and select it only to be used on this product via product configuration...

The add to cart has "data-addto-div" attribute and by it's value (which is form name) you add all products to cart....

Now the issue is that i have to wrap it also in the form tag in order for it to work but i can't use form inside form as this is not valid html...

Is there a way to use div id insteed of form tag? Or any other way?

Any advise would be welcome.

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

  • Posts: 83041
  • Thank you received: 13405
  • MODERATOR
5 years 10 months ago #303515

Hi,

I was thinking that you would create your own page with your own HTML and use the canonial URL setting of the product to actually redirect to that custom page where you can have your own form, with your own dropdowns/add to cart button. That way, you have more freedom.

The following user(s) said Thank You: kyratn

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

  • Posts: 1119
  • Thank you received: 114
5 years 10 months ago #303638

Hi,

So i almost done all customization and it looks like it is working fine. I have one last issue which i hope you can help me with.

Is there a way to show original and discounted price instead of showing only original price for "Price with options" price?

Thanks

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

  • Posts: 83041
  • Thank you received: 13405
  • MODERATOR
5 years 10 months ago #303658

Hi,


There is no way to do that with the "price with options". That's not impossible to add, but not that easy as you would have to modify the javascript of the options system to calculate the discounted price with options.

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

  • Posts: 1119
  • Thank you received: 114
5 years 10 months ago #303693

Hi,

Well, i have removed that js code as it not used and our all variants have same price. Used some code to sum options price together and it works fine.

Now, is there a way to get product option price in product listing? Did some var_dump but couldn't find any.

Thank you

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

  • Posts: 83041
  • Thank you received: 13405
  • MODERATOR
5 years 10 months ago #303713

Hi,

Not easily. The options data is not even loaded from the database. So it would require adding MySQL queries to load the data, display the dropdowns, and add your own JS to do the calculations and refresh the displayed amount. And then some more to have the add to cart button and take into account the option when you use it.
All that is not impossible but clearly a lot more complex.

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

  • Posts: 1119
  • Thank you received: 114
5 years 10 months ago #303721

Hi,

I am not looking to have all data, i just need to check if product has options and if yes then show the price of those option only. This seems require query too?

I am not good at writing such queries so if you could give me quick example i would be very thankful.

Regards

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

  • Posts: 83041
  • Thank you received: 13405
  • MODERATOR
5 years 10 months ago #303726

Hi,

As I said, it will require loading the data of the options.
The prices require the product data, and the variants data of the product if the options have variants.
So it's not just a quick example. It will require tens of lines of code, and if you want to handle the potential discounts on the prices, the access levels, etc it complexify the code.

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

Time to create page: 0.081 seconds
Powered by Kunena Forum