- Posts: 34
- Thank you received: 0
Add sample product with price to each existing
-- HikaShop version -- : 2.2.2
-- Joomla version -- : 2.5.20
-- PHP version -- : 5.3.28
-- Browser(s) name and version -- : ANY
My client need to add a sample at a price of $1 to each of her products. The products are uploaded from her in-house POS system so it will need to be added automatically to all products. They will need to know which product the sample is for, and extra shipping will not be charged. Can you describe the best way to do this? Thanks.
Please Log in or Create an account to join the conversation.
What you can do is this:
Create a general sample product via the menu System>Products and set a price of $1 for it. You can put it in an unpublished category if you don't went to have it displayed by default on the products listings.
Then, create a custom field of the table "item" and of the type "text" via the menu Display>Custom fields (Business edition only) and restrict it to the unpublished category where your sample product is attached so that you don't get it on the product page of other products.
Finally, You can add a link like that in your products:
When the user will click on that link on a product page, it will add the sample product to the cart with the name of the product filled in the custom field and he will be redirected to the checkout in order to proceed.
Please Log in or Create an account to join the conversation.
I have added a product: fabricsandfringe.com/cart/fabrics-fringe...ct/1200311568-sample
And a custom field: (I do not have an "item" table, but I have a product table. I think this name was changed to sync with their POS. Anyway, I added the text field labeled "Sample" with column name "sample"
And I inserted this code:
<a href="http://http://fabricsandfringe.com/cart/index.php?option=com_hikashop&ctrl=product&task=updatecart&quantity=1&checkout=1&product_id=sample&data[item][Sample]=product_name">Order a Sample</a>
But I'm sure I did something wrong somewhere. Could you take a look and see where I made the error(s)? Thanks in advance.
View here:
fabricsandfringe.com/cart/fabric-categor...ber-black-candy-pink
Please Log in or Create an account to join the conversation.
It doesn't work because you need to create a custom field of the table "item" and not of the table "product".
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
"Yard" is not a default type, that's maybe the item one which has been renamed.
Thanks to try this type.
Please Log in or Create an account to join the conversation.
<a href="http://http://fabricsandfringe.com/cart/index.php?option=com_hikashop&ctrl=product&task=updatecart&quantity=1&checkout=1&product_id=sample&data[item][Sample]=product_name">Order a Sample</a>
I am not really a coder, so I need advice if the above is correct. Thank you so much for your help thus far.
Please Log in or Create an account to join the conversation.
Also, you replaced "YYY" with "Sample" in the URL. This will only work if the custom field column name is "Sample" but normally you should not have any uppercase there...
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Sorry I'm not sure to understand correctly what you need.
Could you give more details, example, screenshot ?
Please Log in or Create an account to join the conversation.
Each product can have a sample. When the customer orders, we must know which product they want to sample to be from.
So on the product page, (attachment 1), when the customer adds the sample to their cart, we would like to return to product category, instead of "sample" category.
When the sample is placed in the cart, we need the product name appended to the Sample name (see attachment 2) so both the customer and the client knows what product to cut the sample from.
Thanks again for your help. I will be installing yet another Hikashop cart shortly. It is my cart of choice :kiss:
Please Log in or Create an account to join the conversation.
Ok so to understand correctly, you have only one product named "sample" and you need to specify the product from where the customer added the sample.
I think that this will require a plugin based on the function "onBeforeCartUpdate()", add a parameter in the url which will be the id of the current product, and then you can manage things to change the product name from "sample" to "sample of XXX" for example.
A work around could be to simply create as may samples as you have products, and specify the id of each sample in the corresponding product page. You can use the custom product fields to specify his id and get it dynamically for the url.
www.hikashop.com/support/support/documen...umentation.html#cart
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
As it is not available by default in HikaShop, yes I recommend to hire a developer for that.
You can potentially use the "commercial jobs" part of this forum to post your request.
Please Log in or Create an account to join the conversation.