Mv Question: How To Have Vendor Shop Open In An Other Tab Automatically

hi,

I am trying to figure this out , I want customers when on a product page and clicking on the vendors name to see more in its shops , with the shop automatically opening in a new tab

like this customer can quickly browse , close the window, and keep on looking at products on main products pages

thanks for your very appreciated suggestions !

Add a 'target="_blank"' to the resulting anchor tag. You can do this via a template hook. You might also be able to just do it with javascript by adding the attribute to the related anchor tag.

Add a 'target="_blank"' to the resulting anchor tag. You can do this via a template hook. You might also be able to just do it with javascript by adding the attribute to the related anchor tag.

thank you for your reply

I am on template hook

But I am not sure which one to modify and where exactly in the anchor tag I should add it

Thank you very much

  • iews/products/view.tpl
  • addons/product_variations/hooks/products/layout_content.pre.tpl
  • blocks/product_templates/default_template.tpl
  • views/companies/components/product_company_data.tpl
  • addons/vendor_communication/hooks/companies/product_company_data.post.tpl
  • addons/vendor_communication/views/vendor_communication/components/new_thread_button.tpl

The following file is used on the product details page

design/themes/responsive/templates/views/companies/components/product_company_data.tpl

The following file is used on the product details page

design/themes/responsive/templates/views/companies/components/product_company_data.tpl

hi,

Thank you but where should I add 'target="_blank"' in this :(. design/themes/responsive/templates/views/companies/components/product_company_data.tpl) please ? in the middle at the begining , or the end ?

thank you

I would recommend you override that file. You'd do that by copying the file to design/themes/responsive/templates/addons/my_changes/overrides/views/companies/components/product_companies_data.tpl

You would then modify that file and change the line from:

{if $company_name}{$company_name}{else}{$company_id|fn_get_company_name}{/if}

to

{if $company_name}{$company_name}{else}{$company_id|fn_get_company_name}{/if}

Then clear your cache. The reason I recommend overriding the template is that there are no hooks in the template to accomplish your goal AND that using an override will prevent your changes from being overwritten in a future upgrade. You should verify after an upgrade that there are not further changes made to that template that you want to incorporate into your override.

I would recommend you override that file. You'd do that by copying the file to design/themes/responsive/templates/addons/my_changes/overrides/companies/components/product_copy_data.tpl

You would then modify that file and change the line from:

{if $company_name}{$company_name}{else}{$company_id|fn_get_company_name}{/if}

to

{if $company_name}{$company_name}{else}{$company_id|fn_get_company_name}{/if}

Then clear your cache. The reason I recommend overriding the template is that there are no hooks in the template to accomplish your goal AND that using an override will prevent your changes from being overwritten in a future upgrade. You should verify after an upgrade that there are not further changes made to that template that you want to incorporate into your override.

hi,

That sounds smart thank you for your message

But i cannot find this path :

design/themes/responsive/templates/addons/my_changes/overrides/companies/components/product_copy_data.tpl

my_changes/override

nor

product_copy_data.tpl

only :

responsive / template/ add on /

or

or

emerald_theme / templates/ addons / hooks / product/

thank you very much for taking the time , very appreciated !

You have to create the path yourself. That's the whole point of the my_changes addon...to be able to override/change the core without changing the core files. Also make sure the my_changes addon is installed and enabled.

1. If you make changes with the My changes module, do not forget to check if the module is installed and active. Also clear cache afer the

2. Tony made a typo. Correct file path and name is

design/themes/responsive/templates/addons/my_changes/overrides/views/companies/components/product_companies_data.tpl

3. After the file is created, do not forget to clear cache

Thanks for the catch Ecom. Path corrected in original post.

Thank you both for your help on this , I am yet to try as my access to admin panel is denied for the moment and should be fixed today .

and thats correct i did not activated ' my change add on '

So thanks for this .

Will feedback you once i succeed on it , but should be a breeze, as you explained it perfectly

thanks a lot !

Hello,

for some reasons i still do not understand , I could not add any line in the file.

I created the path , created the TPL file, and then I could not add any line in there.

Helpdesk, just did it for me , but really what I expected was more an explanation as it could be helpful for the future

so in the tpl files product_companies_data.tpl

this can be found now:

{if "MULTIVENDOR"|fn_allowed_for && ($company_name || $company_id) && $settings.Vendors.display_vendor == "Y"}
{hook name="companies:product_company_data"}
{__("vendor")}:
target="_blank">{if $company_name}{$company_name}{else}{$company_id|fn_get_company_name}{/if}
{/hook}
{/if}
I did not expected all the lines before target blank
is this something i have to write before using any my_changes add-ons ?
I am so confused
Thank you !

To override the template with addon, copy content of the product_companies_data.tpl file to design/themes/responsive/templates/addons/my_changes/overrides/views/companies/components/product_companies_data.tpl and add necessary corrections

Thank you

DO NOT modify the distributed template itself. Your changes may be overwritten in a future upgrade. Both Ecom and I have given you all the info you need to do it properly. If you did not see the changes, then either you put the override file in the wrong place or you did NOT clear your cache after creating the override file. The only other possibility is that a higher priority addon is overriding the file first. But that is unlikely.

DO NOT modify the distributed template itself. Your changes may be overwritten in a future upgrade. Both Ecom and I have given you all the info you need to do it properly. If you did not see the changes, then either you put the override file in the wrong place or you did NOT clear your cache after creating the override file. The only other possibility is that a higher priority addon is overriding the file first. But that is unlikely.

Seth ,

thank you for your message

{if "MULTIVENDOR"|fn_allowed_for && ($company_name || $company_id) && $settings.Vendors.display_vendor == "Y"}
{hook name="companies:product_company_data"}
{__("vendor")}:
target="_blank">{if $company_name}{$company_name}{else}{$company_id|fn_get_company_name}{/if}
{/hook}
{/if}
there is all this that helpdesk added below: (Where am i supposed to find all this to write in the file ?)
{if "MULTIVENDOR"|fn_allowed_for && ($company_name || $company_id) && $settings.Vendors.display_vendor == "Y"}
{hook name="companies:product_company_data"}
{__("vendor")}:
but i dont know where it comes from, or how i could have guessed it , since i was supposed to create a path and put in the file ONLY this ?
" target="_blank">{if $company_name}{$company_name}{else}{$company_id|fn_get_company_name}{/if}
its working now, but i wish i had been successful in the process because i have other changes to do , i want to learn and understand .
Thank you for your help , you both have been perfect honestly , and you explained perfectly
edit: yes i have now found my mistake , it is so stupid, that i cannot think writing it down here . but hey :
the .tpl instead of making it a file , i created it as a folder , and then created a file calling it 'store tab' :neutral:

obviously it did not work .

sorry you must feel really disappointed in humans right now :-o

You're fine. Language and experience can all be obstacles. Glad you got it working properly. Cs-cart will always take the shortest path (not the best path). Hence you'll come back to them again after an upgrade.

You're fine. Language and experience can all be obstacles. Glad you got it working properly. Cs-cart will always take the shortest path (not the best path). Hence you'll come back to them again after an upgrade.

So this is not the path you would have created ?

I have about 11 notifications for upgrade , but i dont see the point of upgrading every few days or should I ?

you seem to say that after upgrade , my changes will be overwritten ? so i'll have to redo the paths again everytime ?

I am happy to re do it your way , if it can save me the overwritting later on

thank you

You didn't say that cs-cart created the override file. Given it's an override, the content is the same as the standard file with exception of the 'action' attribute. If they did it in the my_changes/override directory tree, that's great (they usually don't). Helps to associate paths with content.... All good.

You didn't say that cs-cart created the override file. Given it's an override, the content is the same as the standard file with exception of the 'action' attribute. If they did it in the my_changes/override directory tree, that's great (they usually don't). Helps to associate paths with content.... All good.

ok got it !

Thank you very much for your time , that is very appreciated !