[Skip to main content](#vessel-content)

#   Product sku replaced by another sku

##

- **[marcob@polarisitalia.com](/forum/user/37355-marcob-polarisitalia-com "View marcob@polarisitalia.com's Profile")**
- [![marcob@polarisitalia.com's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/37355-marcob-polarisitalia-com "View marcob@polarisitalia.com's Profile") Topic Author
- [ Offline](/forum/user/37355-marcob-polarisitalia-com)

Less More

- Posts: 21
- Thank you received: 3
-
-

8 years 7 months ago [\#291451](#291451) by [marcob@polarisitalia.com](/forum/user/37355-marcob-polarisitalia-com "View marcob@polarisitalia.com's Profile")  *[Product sku replaced by another sku](/forum/26-product-category-display/894472-product-sku-replaced-by-another-sku#291451 "-- url of the page with the problem -- :   www.egimotors.it  -- HikaShop version -- : 3.4 -- Joomla version -- : 3.8.6 -- PHP version -- : 7  Hi, in my eshop i have many products SKU replaced by another SKU, for example:  product &quot;belt hd sku 255&quot; replace by &quot;belt hd sku 266&quot; can i redirect automatically from 255 to 266?  thanks in advance")* was created by *[marcob@polarisitalia.com](/forum/user/37355-marcob-polarisitalia-com "View marcob@polarisitalia.com's Profile")*

-- url of the page with the problem -- : [ www.egimotors.it](http://www.egimotors.it)
-- HikaShop version -- : 3.4
-- Joomla version -- : 3.8.6
-- PHP version -- : 7

Hi, in my eshop i have many products SKU replaced by another SKU, for example:

product "belt hd sku 255" replace by "belt hd sku 266" can i redirect automatically from 255 to 266?

thanks in advance

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84OTQ0NzItcHJvZHVjdC1za3UtcmVwbGFjZWQtYnktYW5vdGhlci1za3U/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")**
- [![Mohamed Thelji's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar6861.png)](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")
- [ Offline](/forum/user/6861-mohamed-thelji)

Less More

- Posts: 12953
- Thank you received: 1778
-
-
-

8 years 7 months ago [\#291465](#291465) by [Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")  Replied by *[Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")* on topic *[Product sku replaced by another sku](/forum/26-product-category-display/894472-product-sku-replaced-by-another-sku#291465 "-- url of the page with the problem -- :   www.egimotors.it  -- HikaShop version -- : 3.4 -- Joomla version -- : 3.8.6 -- PHP version -- : 7  Hi, in my eshop i have many products SKU replaced by another SKU, for example:  product &quot;belt hd sku 255&quot; replace by &quot;belt hd sku 266&quot; can i redirect automatically from 255 to 266?  thanks in advance")*

Hello,

Can you give us more information about how you created and configured your products through some screenshots for example so that we can have a better understanding of your issue ?

Thank you.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84OTQ0NzItcHJvZHVjdC1za3UtcmVwbGFjZWQtYnktYW5vdGhlci1za3U/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[marcob@polarisitalia.com](/forum/user/37355-marcob-polarisitalia-com "View marcob@polarisitalia.com's Profile")**
- [![marcob@polarisitalia.com's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/37355-marcob-polarisitalia-com "View marcob@polarisitalia.com's Profile") Topic Author
- [ Offline](/forum/user/37355-marcob-polarisitalia-com)

Less More

- Posts: 21
- Thank you received: 3
-
-

8 years 7 months ago [\#291524](#291524) by [marcob@polarisitalia.com](/forum/user/37355-marcob-polarisitalia-com "View marcob@polarisitalia.com's Profile")  Replied by *[marcob@polarisitalia.com](/forum/user/37355-marcob-polarisitalia-com "View marcob@polarisitalia.com's Profile")* on topic *[Product sku replaced by another sku](/forum/26-product-category-display/894472-product-sku-replaced-by-another-sku#291524 "-- url of the page with the problem -- :   www.egimotors.it  -- HikaShop version -- : 3.4 -- Joomla version -- : 3.8.6 -- PHP version -- : 7  Hi, in my eshop i have many products SKU replaced by another SKU, for example:  product &quot;belt hd sku 255&quot; replace by &quot;belt hd sku 266&quot; can i redirect automatically from 255 to 266?  thanks in advance")*

thank you for your answer... look the example image you can see the old Sku 0450578 and the new SKU 0450251 if I search in my hikashop 0450578 I want to link in the description a link to 0450251.
Is it's possible put a link "these code is old, click here for the right code/sku 0450251"
[ ![egimotors hikashop](http://www.egimotors.it/images/hikashop.jpg) ](http://www.egimotors.it/images/hikashop.jpg "egimotors hikashop")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84OTQ0NzItcHJvZHVjdC1za3UtcmVwbGFjZWQtYnktYW5vdGhlci1za3U/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")**
- [![Mohamed Thelji's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar6861.png)](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")
- [ Offline](/forum/user/6861-mohamed-thelji)

Less More

- Posts: 12953
- Thank you received: 1778
-
-
-

8 years 7 months ago [\#291525](#291525) by [Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")  Replied by *[Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")* on topic *[Product sku replaced by another sku](/forum/26-product-category-display/894472-product-sku-replaced-by-another-sku#291525 "-- url of the page with the problem -- :   www.egimotors.it  -- HikaShop version -- : 3.4 -- Joomla version -- : 3.8.6 -- PHP version -- : 7  Hi, in my eshop i have many products SKU replaced by another SKU, for example:  product &quot;belt hd sku 255&quot; replace by &quot;belt hd sku 266&quot; can i redirect automatically from 255 to 266?  thanks in advance")*

Hello,

Your issue is probably coming from the fact that the SKU number that you are trying to apply to your product is already taken by another product so when creating that product Hikashop will either alter the SKU number or tell you that it's already applied to another product.
You should probably change these SKU number directly one by one.

> Is it's possible put a link "these code is old, click here for the right code/sku 0450251"

Sure, you can eventually add it through your product description.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84OTQ0NzItcHJvZHVjdC1za3UtcmVwbGFjZWQtYnktYW5vdGhlci1za3U/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[marcob@polarisitalia.com](/forum/user/37355-marcob-polarisitalia-com "View marcob@polarisitalia.com's Profile")**
- [![marcob@polarisitalia.com's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/37355-marcob-polarisitalia-com "View marcob@polarisitalia.com's Profile") Topic Author
- [ Offline](/forum/user/37355-marcob-polarisitalia-com)

Less More

- Posts: 21
- Thank you received: 3
-
-

8 years 7 months ago -  8 years 7 months ago [\#291601](#291601) by [marcob@polarisitalia.com](/forum/user/37355-marcob-polarisitalia-com "View marcob@polarisitalia.com's Profile")  Replied by *[marcob@polarisitalia.com](/forum/user/37355-marcob-polarisitalia-com "View marcob@polarisitalia.com's Profile")* on topic *[Product sku replaced by another sku](/forum/26-product-category-display/894472-product-sku-replaced-by-another-sku#291601 "-- url of the page with the problem -- :   www.egimotors.it  -- HikaShop version -- : 3.4 -- Joomla version -- : 3.8.6 -- PHP version -- : 7  Hi, in my eshop i have many products SKU replaced by another SKU, for example:  product &quot;belt hd sku 255&quot; replace by &quot;belt hd sku 266&quot; can i redirect automatically from 255 to 266?  thanks in advance")*

Thank you for anwser,
now I was able to print the correct code on the screen. I miss the last step build the link with the code that I print. how can i build hikashop url? thank you
i put my code in the file listin_table.php Code:

&lt;?php $a = $this-&gt;row-&gt;product_name; $code = substr($a, 14); // 2016 if (preg_match('/SOSTITUITO DA/',$a)) echo "$code"; ?&gt;

[ www.egimotors.it/hika2.jpg](http://www.egimotors.it/hika2.jpg)

Last edit: 8 years 7 months ago by [marcob@polarisitalia.com](/forum/user/37355-marcob-polarisitalia-com "View marcob@polarisitalia.com's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84OTQ0NzItcHJvZHVjdC1za3UtcmVwbGFjZWQtYnktYW5vdGhlci1za3U/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86584
- Thank you received: 14325
-
-

8 years 7 months ago [\#291610](#291610) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Product sku replaced by another sku](/forum/26-product-category-display/894472-product-sku-replaced-by-another-sku#291610 "-- url of the page with the problem -- :   www.egimotors.it  -- HikaShop version -- : 3.4 -- Joomla version -- : 3.8.6 -- PHP version -- : 7  Hi, in my eshop i have many products SKU replaced by another SKU, for example:  product &quot;belt hd sku 255&quot; replace by &quot;belt hd sku 266&quot; can i redirect automatically from 255 to 266?  thanks in advance")*

Hi,

The URL is available in the variable $link
So you can just do like that: Code:

echo '&lt;a href="'.$link.'"&gt;'.$code.'&lt;/a&gt;';

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84OTQ0NzItcHJvZHVjdC1za3UtcmVwbGFjZWQtYnktYW5vdGhlci1za3U/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[marcob@polarisitalia.com](/forum/user/37355-marcob-polarisitalia-com "View marcob@polarisitalia.com's Profile")**
- [![marcob@polarisitalia.com's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/37355-marcob-polarisitalia-com "View marcob@polarisitalia.com's Profile") Topic Author
- [ Offline](/forum/user/37355-marcob-polarisitalia-com)

Less More

- Posts: 21
- Thank you received: 3
-
-

8 years 7 months ago -  8 years 7 months ago [\#291654](#291654) by [marcob@polarisitalia.com](/forum/user/37355-marcob-polarisitalia-com "View marcob@polarisitalia.com's Profile")  Replied by *[marcob@polarisitalia.com](/forum/user/37355-marcob-polarisitalia-com "View marcob@polarisitalia.com's Profile")* on topic *[Product sku replaced by another sku](/forum/26-product-category-display/894472-product-sku-replaced-by-another-sku#291654 "-- url of the page with the problem -- :   www.egimotors.it  -- HikaShop version -- : 3.4 -- Joomla version -- : 3.8.6 -- PHP version -- : 7  Hi, in my eshop i have many products SKU replaced by another SKU, for example:  product &quot;belt hd sku 255&quot; replace by &quot;belt hd sku 266&quot; can i redirect automatically from 255 to 266?  thanks in advance")*

Hi Nicolas, thank you for your answer.
I would like to link the code product insert of the product name, now i have these php code: Code:

&lt;?php $a = $this-&gt;row-&gt;product_name; $code = substr($a, 14); // 2016 if (preg_match('/SOSTITUITO DA/',$a)) //echo "$code"; $idsku = $this-&gt;row-&gt;product_id; echo "$idsku"; $hikaurl = "&lt;a href=\"http://www.egimotors.it/index.php?option=com_hikashop&amp;ctrl=product&amp;task=show&amp;cid=$idsku\"&gt;Vedi codice&lt;/a&gt;"; echo "$hikaurl"; ?&gt;

and the product name is "SOSTITUITO DA 0450249 ", how can I get the product_id of the code 0450249?

thanks in advance
Marco

Last edit: 8 years 7 months ago by [marcob@polarisitalia.com](/forum/user/37355-marcob-polarisitalia-com "View marcob@polarisitalia.com's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84OTQ0NzItcHJvZHVjdC1za3UtcmVwbGFjZWQtYnktYW5vdGhlci1za3U/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")**
- [![Mohamed Thelji's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar6861.png)](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")
- [ Offline](/forum/user/6861-mohamed-thelji)

Less More

- Posts: 12953
- Thank you received: 1778
-
-
-

8 years 7 months ago -  8 years 7 months ago [\#291670](#291670) by [Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")  Replied by *[Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")* on topic *[Product sku replaced by another sku](/forum/26-product-category-display/894472-product-sku-replaced-by-another-sku#291670 "-- url of the page with the problem -- :   www.egimotors.it  -- HikaShop version -- : 3.4 -- Joomla version -- : 3.8.6 -- PHP version -- : 7  Hi, in my eshop i have many products SKU replaced by another SKU, for example:  product &quot;belt hd sku 255&quot; replace by &quot;belt hd sku 266&quot; can i redirect automatically from 255 to 266?  thanks in advance")*

Hello,

To do that, you'll ether have to manually search it through your back-end product listing or to use an SQL request through your code if your want it to be dynamic. Something like that: Code:

$db = JFactory::getDBO(); $db-&gt;setQuery('SELECT product_id FROM #__hikashop_product WHERE product_code='.$db-&gt;Quote($code)); $id = $db-&gt;loadResult();

[ docs.joomla.org/Selecting\_data\_using\_JDatabase](https://docs.joomla.org/Selecting_data_using_JDatabase)

Best regards,
Mohamed Thelji.

Last edit: 8 years 7 months ago by [nicolas](/forum/user/63-nicolas "View nicolas's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84OTQ0NzItcHJvZHVjdC1za3UtcmVwbGFjZWQtYnktYW5vdGhlci1za3U/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[marcob@polarisitalia.com](/forum/user/37355-marcob-polarisitalia-com "View marcob@polarisitalia.com's Profile")**
- [![marcob@polarisitalia.com's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/37355-marcob-polarisitalia-com "View marcob@polarisitalia.com's Profile") Topic Author
- [ Offline](/forum/user/37355-marcob-polarisitalia-com)

Less More

- Posts: 21
- Thank you received: 3
-
-

8 years 6 months ago [\#291943](#291943) by [marcob@polarisitalia.com](/forum/user/37355-marcob-polarisitalia-com "View marcob@polarisitalia.com's Profile")  Replied by *[marcob@polarisitalia.com](/forum/user/37355-marcob-polarisitalia-com "View marcob@polarisitalia.com's Profile")* on topic *[Product sku replaced by another sku](/forum/26-product-category-display/894472-product-sku-replaced-by-another-sku#291943 "-- url of the page with the problem -- :   www.egimotors.it  -- HikaShop version -- : 3.4 -- Joomla version -- : 3.8.6 -- PHP version -- : 7  Hi, in my eshop i have many products SKU replaced by another SKU, for example:  product &quot;belt hd sku 255&quot; replace by &quot;belt hd sku 266&quot; can i redirect automatically from 255 to 266?  thanks in advance")*

Hi, good sounds your ideas about the query, i put these code: Code:

&lt;?php $a = $this-&gt;row-&gt;product_name;//inizializzo la varibile $a $code = substr($a, 14); // selezione il codice dalla variabile $a // Get a db connection. $db = JFactory::getDbo(); // Create a new query object. $query = $db-&gt;getQuery(true); // Select all records from the user profile table where key begins with "custom.". // Order it by the ordering field. $query-&gt;select($db-&gt;quoteName(array('product_id'))); $query-&gt;from($db-&gt;quoteName('#_hikashop_product')); $query-&gt;where($db-&gt;quoteName('product_code') . ' = '. $db-&gt;quote($code)); // Reset the query using our newly populated query object. $db-&gt;setQuery($query); // Load the results as a list of stdClass objects (see later for more options on retrieving data). $results = $db-&gt;loadAssoc(); $id= $results['product_id']; if (preg_match('/SOSTITUITO DA/',$a))//stampo il link solo se $a contiene sostituito da $hikaurl = "&lt;a target=\"_blank\" href=\"http://www.egimotors.it/index.php?option=com_hikashop&amp;ctrl=product&amp;task=show&amp;cid=$id\" id=\"btn-1524838088074\" class=\"sppb-btn sppb-btn-danger sppb-btn-xs sppb-btn-rounded\"&gt;&lt;i class=\"fa fa-angle-double-right\"&gt;&lt;/i&gt; Vedi codice corretto&lt;/a&gt;"; echo "$hikaurl"; ?&gt;

and now i have that i want.

Thank you, very much

Regards

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84OTQ0NzItcHJvZHVjdC1za3UtcmVwbGFjZWQtYnktYW5vdGhlci1za3U/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.102 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
