Problems creating products with brackets in name

  • Posts: 108
  • Thank you received: 6
9 years 6 months ago #175005

-- url of the page with the problem -- : siftmrkts.com
-- HikaShop version -- : 2.3.3
-- HikaMarket version -- : 1.4.4
-- Joomla version -- : 3.3.3

Hi,

currently when I create a oroduct that has a bracket in the name e.g. boots (1949), the product will not appear

either a 404 error or "product cannot be found" error. When I check the product from the backend it appears the alias is not created. manually adding the alias does not solve the problem, but if I remove the brackets and resize it usually appears.

I have put this in the hikamarket section as I thought it may have something to do with the product template too??

thanks

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

  • Posts: 26000
  • Thank you received: 4004
  • MODERATOR
9 years 6 months ago #175006

Hi,

I don't think that the problem is related to the product template.
As long as the HikaMarket saveForm have the line

if(!in_array($k, array('product_code','product_alias')) && !isset($product->$k))
the product_alias can't be override by HikaMarket so HikaShop will receive an empty value for the product_alias and will be able to generate it.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 108
  • Thank you received: 6
9 years 6 months ago #175688

apologies where is the saveForm located or is part of one of the Hikamarket views? I couldnt see any reference to the code in the productmarket/form file

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

  • Posts: 26000
  • Thank you received: 4004
  • MODERATOR
9 years 6 months ago #175690

Hi,

The saveForm is a function of the HikaMarket product class (administrator/components/com_hikamarket/classes/product.php).
I wanted to say that the product_alias and the product_code are not copied from the template to the product, so they shouldn't affect the product during the save.

But, if the fields are available for the vendor in the front-end, it is highly possible that the content from the product template is loaded and displayed in the product edition page when you create a new product.
The product template fill the product page with all is content in order to have "default content".

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 108
  • Thank you received: 6
9 years 6 months ago #175714

thanks,
the code exists in the product.php file, so not sure why the brackets affect the appearance of the product?

in the frontend users only have the option to fill out the title. The code, alias etc is generated automatically

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

  • Posts: 26000
  • Thank you received: 4004
  • MODERATOR
9 years 6 months ago #175734

Hi,

If you create the product in the HikaShop backend, do you have the same trouble ?

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
Last edit: 9 years 6 months ago by Jerome.

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

  • Posts: 108
  • Thank you received: 6
9 years 5 months ago #177185

Hi Jerome,
no it seems to be ok creating a product with brackets from the backend.

edit on what appears to be happening:

from the frontend:

  • create a product with brackets in the title
  • alias is not created
  • therefore product appears in categories but when clicked product cannot be found
  • remove brackets, alias is created

  • from the backend:
  • create a product with brackets in the title
  • alias IS created
  • product is ok

I guess that means something to do with the product template creating the alias (as far as brackets is concerned)?

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

  • Posts: 26000
  • Thank you received: 4004
  • MODERATOR
9 years 5 months ago #177204

Hi,

Nothing related to the product template.
HikaMarket does not generate the product alias but the HikaShop router does.
I think that if the product have a bracket, the router can't do his job properly for the alias generation so the best is to use the HikaShop code from the "saveForm" function for the HikaMarket "frontSaveForm" one.
By replacing:

		$status = $this->save($product);
		if($status) {
By
		if($shopConfig->get('alias_auto_fill', 1) && empty($product->product_alias)) {
			$productClass->addAlias($product);
			// add a letter at the beginning of the alias to avoid issues when the alias of a product starts with a number
			if($shopConfig->get('sef_remove_id', 0) && (int)$product->alias > 0)
				$product->alias = $shopConfig->get('alias_prefix', 'p') . $product->alias;
			$product->product_alias = $product->alias;
			unset($product->alias);
		}

		$status = $this->save($product);
		if($status) {
And it should be better.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 108
  • Thank you received: 6
9 years 5 months ago #177238

Hi Jerome,

I receive this error when I attempt to add a product after making the change

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 category_id FROM jos_hikashop_product_category WHERE product_id=

when I remove the customisation it is ok again...

thanks

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

  • Posts: 26000
  • Thank you received: 4004
  • MODERATOR
9 years 5 months ago #177242

Hi,

I don't see the link between the code I gave you and the SQL error you got.
I understand that the query is incompleted because the product id is missing but I don't see why the patch will do that.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 108
  • Thank you received: 6
9 years 5 months ago #177244

agreed it seems odd,

though it is definitely set off by adding this code :ohmy:

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

  • Posts: 26000
  • Thank you received: 4004
  • MODERATOR
9 years 5 months ago #177246

Hi,

I am integrated the patch in the next build ; I will perform some tests and will fix it.
I want to release HIkaMarket 1.5.0 for the end of the month (or next week if I found too much things to change).

For the moment my tests are going well but I'm not fully happy with the rendering under Joomla 2.5 (with the default template) but in Joomla 3.x it's not bad at all.
But what I am sure is that, the next release will be the bigger release on HikaMarket I ever made since the 1.0.0 version !

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 108
  • Thank you received: 6
9 years 5 months ago #177357

great thanks Jerome, cant wait for it!

I rolled back the change and since then I havent been able to add a product front end or back. I just get a 404 error.

in the front end an alias is not created. In the back end an alias is created but the new products still have a 404 error.

I decided to upgrade to the latest version of hikashop & hikamarket and I still have the same problem (which is odd)

I checked com_hikamarket/classes/product.php to re-add the changes we have been through and they all look implemetend throughout -is there any other files that affect the saving of a product that I should check?

thanks

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

  • Posts: 108
  • Thank you received: 6
9 years 5 months ago #177358

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

  • Posts: 26000
  • Thank you received: 4004
  • MODERATOR
9 years 5 months ago #177374

Hi,

Regarding the error you got, I think it is related to the SEF system and not to HikaShop/HikaMarket.
The 404 said that the "page" is not found.
But if I try with a page like : siftmrkts.com/vintage/vroom-product
I got a working HikaShop page telling that the product does not exists.

So I guess it's SEF related.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 108
  • Thank you received: 6
9 years 5 months ago #177385

thanks Jerome,

a little bit of searching led me to try turning off the option to remove ID's in the URL (In Hikashop)

this fixed it, and also inadvertently solved the problem with the brackets!! I'm guessing its something to do with the way it strips the special characters??

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

  • Posts: 26000
  • Thank you received: 4004
  • MODERATOR
9 years 5 months ago #177388

Hi,

It's highly possible yes.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

Moderators: Obsidev
Time to create page: 0.085 seconds
Powered by Kunena Forum