Text box on product page gives SQL error

  • Posts: 16
  • Thank you received: 2
11 years 1 month ago #154558

Hi,
Today I purchased Hikashop Business as I needed to add a box on the product page for a customer to specify customisation or colour. I went into Display -> Custom Field and created an item / text to be able to add to the product page.

When I add this to the product page and hit save, I get an error:
An error has occurred.
1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1 SQL=SELECT product_code, product_id FROM jp_hikashop_product WHERE product_code IN ()

Joomla 3.3.0 & PHP 5.4.17

What am I doing wrong please?

Many thanks in advance,
Alison

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

  • Posts: 16
  • Thank you received: 2
11 years 1 month ago #154602

This further information may help: after the error if you go into the product you can see it has inserted the text box which is at the bottom but it also inserts something blank with no value at the top.

On the front end, it only shows the text box, until you delete the text box characteristic and the blank no value one too, then the other characteristics do not show up in the front end at all.

Attachments:

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

  • Posts: 13201
  • Thank you received: 2322
11 years 1 month ago #154559

Hi,

I am not able to reproduce the problem on my end, can you try to edit the file "administrator/components/com_hikashop/classes/product.php" and in the function "updateCharacteristics()" add:

					$variantCodes = array();
Before:
					foreach($completeVariants as $variant){

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

  • Posts: 16
  • Thank you received: 2
11 years 1 month ago #154999

Thank you for the reply Xavier.

For some reason if I insert that code where you specify (if I am doing it correctly!) it makes Hikashop completely inaccessible in the back end (just a blank page although all other Joomla backend pages are available as usual) and the front end is also showing a completely blank site.

I upgraded to the Business version specifically for this feature so I really do need to get it working. :-/

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

  • Posts: 83935
  • Thank you received: 13591
  • MODERATOR
11 years 1 month ago #155015

Your SQL error is not linked to the custom item field.
The SQL error and the "no values found" messages indicate that the integrity of the data between your product variants and your product characteristics is broken.
Please follow the instructions in the documentation in order to regenerate your variants/characteristics and it should work:
www.hikashop.com/support/support/documen...html#characteristics

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

  • Posts: 16
  • Thank you received: 2
11 years 4 weeks ago #155421

Hi Nicolas
Thank you for your reply.
I think I have followed the instructions correctly and I have regenerated the variants / characteristics.
I tried to delete the custom field but I get the following error:



So I left it and then created a new custom item field, and assigned that to a category. That now shows up on the front end fine. But if you go to my test item at ndm.com.gridhosted.co.uk/index.php/shop/...duct/52-bunny-jacket and type something in the custom field box you get an error:



Please can you advise further?

Also two more questions:
1. The customer will be able to choose from approx 30 fabrics for the inside and 30 fabrics from the outside, plus a size. The fabric choices have no impact on the price. However, sizes will need to be different prices. Is it possible to get the price to change just based on the size, rather than having to go through every single possible variant of fabric choices and size (the number of variants will be far too many to manage)

2. On the product page I entered an additional price in error into the "price" options area. How do I delete this?

I look forward to hearing from you. Thank you.
Alison

Attachments:

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

  • Posts: 83935
  • Thank you received: 13591
  • MODERATOR
11 years 4 weeks ago #155425

Hi,

That's because the column name of your custom field is too long so it couldn't be created.
Unpublish it and then create a new one with a column name with a normal length and it will work.

If you want to change the price dynamically based on a custom field, that's possible yes. You need to create a quantity price override plugin like the donation plugin that is already install with HikaShop Business:
demo.hikashop.com/index.php?option=com_h...show&cid=214&lang=en

To delete a price, set a value of 0 in it and it will be removed.

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

  • Posts: 16
  • Thank you received: 2
11 years 4 weeks ago #155590

Hi Nicolas,
That's really helpful - thank you. Shortening the column name is working great. What's the maximum number of characters please?

I have tried creating a price override:



But I must be doing something wrong as although it appears as an option and listed in the basket it doesn't actually affect the price. Does the master price need removing?



With regards to the price I entered in error, I made it 0 but it still remains now:



So how else can I remove the price entered in error?

I very much appreciate your help.

Attachments:

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

  • Posts: 83935
  • Thank you received: 13591
  • MODERATOR
11 years 4 weeks ago #155615

Hi,

1. In the values of the field, please enter only the value like "30", without any symbol. That should help.

2. Could you provide a screenshot of your product edition page with the prices area in it ?

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

  • Posts: 16
  • Thank you received: 2
11 years 3 weeks ago #155775

Hi again Nicolas, and thank you for your reply.

No matter what value I put in it does not affect the sales price of the product. I tried just entering "30" and "32" but then if you added the product to the basket, the price remained at whatever the default price was of the product. If I entered "30.00" and "32.00" then adding the product to the basket still remained at default price.
Basket showing


Backend view:


What more information can I give you to get this working?

Here's the screenshot of the product page with the prices area as requested:



Look forward to hearing from you.

Kind regards
Alison

Attachments:
Last edit: 11 years 3 weeks ago by Tiggia.

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

  • Posts: 13201
  • Thank you received: 2322
11 years 3 weeks ago #155898

Hi,

Sorry I am maybe missing something, but you want to have a custom field which must change the product price, right ?
If it is, it is not possible by default, you have to create characteristics, and then edit the price in the variants, or create a plugin which will change the price dynamically depending on the value of this custom field.

Regarding the "error price", do you have set a user group for this price ? If yes, thanks to remove it, set the price to "0" and save.

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

  • Posts: 16
  • Thank you received: 2
11 years 3 weeks ago #155929

Thank you. The error price has been resolved.

However I am confused by the conflicting advice regarding the custom field changing the error price. I will explain again and please can someone help otherwise I shall have to request a refund and look for an alternative ecommerce package.

Each customer purchasing a jacket will have three choices to make.
Option 1 will be to choose from 30 fabrics
Option 2 will be to choose another fabric from approximately 30
Option 3 will be the size - with 5 options.

I understand that the prices can be changed in the variants but due to the above options there will be TENS AND TENS OF THOUSANDS of variants to deal with - that is just ridiculous. Surely there is a way that only option 3 affects the price?

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

  • Posts: 13201
  • Thank you received: 2322
11 years 3 weeks ago #156030

Hi,

If only the option 3 change the price, so yes, you can use custom fields for options 1 and 2, and use characteristics for the option 3 in order to have only 5 variants and so 5 different prices.

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

  • Posts: 16
  • Thank you received: 2
11 years 3 weeks ago #156073

Thank you so much for making this clear. This works just fine for my requirements :)

One last question (hopefully!)

Now that the prices are variable according to size, on the category page with the products listed as thumbnails I really need it to say "FROM £xx.xx" under each item rather than just one price. Is that possible please?

Attachments:

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

  • Posts: 83935
  • Thank you received: 13591
  • MODERATOR
11 years 3 weeks ago #156092

Hi,

Yes, that's possible. Edit the file "listing_img_title" of the view "product" via the menu Display>views and add your "From" after the line:
<!-- PRODUCT PRICE -->

The following user(s) said Thank You: Tiggia

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

  • Posts: 16
  • Thank you received: 2
11 years 3 weeks ago #156183

Many many thanks Nicolas. I now have answers to all my questions and I do appreciate your patience in helping me.

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

Time to create page: 0.174 seconds
Powered by Kunena Forum