Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

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

 
  • saltwater
  • Advanced Member
  • Members
  • Join Date: 14-May 20
  • 108 posts

Posted 16 July 2020 - 02:02 PM #1

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 !



 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 11762 posts

Posted 16 July 2020 - 06:41 PM #2

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.


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • saltwater
  • Advanced Member
  • Members
  • Join Date: 14-May 20
  • 108 posts

Posted 16 July 2020 - 07:20 PM #3

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


 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 20929 posts

Posted 17 July 2020 - 05:57 AM #4

The following file is used on the product details page

 

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


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    Multi-Vendor PLUS           USD 3100 (2775)
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      Multi-Vendor Ultimate       USD 7500 (6000)

 
  • saltwater
  • Advanced Member
  • Members
  • Join Date: 14-May 20
  • 108 posts

Posted 17 July 2020 - 05:20 PM #5

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 



 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 11762 posts

Posted 17 July 2020 - 07:19 PM #6

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:

<span class="ty-control-group__item ty-company-name"><a href="{"companies.products?company_id=`$company_id`"|fn_url}">{if $company_name}{$company_name}{else}{$company_id|fn_get_company_name}{/if}</a></span>

to

<span class="ty-control-group__item ty-company-name"><a href="{"companies.products?company_id=`$company_id`"|fn_url}" target="_blank" >{if $company_name}{$company_name}{else}{$company_id|fn_get_company_name}{/if}</a></span>

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.


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • saltwater
  • Advanced Member
  • Members
  • Join Date: 14-May 20
  • 108 posts

Posted 18 July 2020 - 10:29 PM #7

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:

<span class="ty-control-group__item ty-company-name"><a href="{"companies.products?company_id=`$company_id`"|fn_url}">{if $company_name}{$company_name}{else}{$company_id|fn_get_company_name}{/if}</a></span>

to

<span class="ty-control-group__item ty-company-name"><a href="{"companies.products?company_id=`$company_id`"|fn_url}" target="_blank" >{if $company_name}{$company_name}{else}{$company_id|fn_get_company_name}{/if}</a></span>

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 !

 

 



 
  • The Tool
  • Been Here Way Too Long Member
  • Members
  • Join Date: 30-Mar 07
  • 3920 posts

Posted 19 July 2020 - 10:44 AM #8

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.



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 20929 posts

Posted 20 July 2020 - 06:00 AM #9

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


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    Multi-Vendor PLUS           USD 3100 (2775)
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      Multi-Vendor Ultimate       USD 7500 (6000)

 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 11762 posts

Posted 20 July 2020 - 07:27 PM #10

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


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • saltwater
  • Advanced Member
  • Members
  • Join Date: 14-May 20
  • 108 posts

Posted 21 July 2020 - 11:14 AM #11

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 !



 
  • saltwater
  • Advanced Member
  • Members
  • Join Date: 14-May 20
  • 108 posts

Posted 26 July 2020 - 11:17 AM #12

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"}
    <div class="ty-control-group{if !$capture_options_vs_qty} product-list-field{/if}">
        {hook name="companies:product_company_data"}
            <label class="ty-control-group__label">{__("vendor")}:</label>
            <span class="ty-control-group__item ty-company-name"><a href="{"companies.products?company_id=`$company_id`"|fn_url}" target="_blank">{if $company_name}{$company_name}{else}{$company_id|fn_get_company_name}{/if}</a></span>
        {/hook}
    </div>
{/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 !


 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 20929 posts

Posted 27 July 2020 - 06:06 AM #13

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


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    Multi-Vendor PLUS           USD 3100 (2775)
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      Multi-Vendor Ultimate       USD 7500 (6000)

 
  • saltwater
  • Advanced Member
  • Members
  • Join Date: 14-May 20
  • 108 posts

Posted 27 July 2020 - 04:58 PM #14

Thank you 



 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 11762 posts

Posted 27 July 2020 - 07:33 PM #15

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.


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • saltwater
  • Advanced Member
  • Members
  • Join Date: 14-May 20
  • 108 posts

Posted 27 July 2020 - 09:28 PM #16

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"}
    <div class="ty-control-group{if !$capture_options_vs_qty} product-list-field{/if}">
        {hook name="companies:product_company_data"}
            <label class="ty-control-group__label">{__("vendor")}:</label>
            <span class="ty-control-group__item ty-company-name"><a href="{"companies.products?company_id=`$company_id`"|fn_url}" target="_blank">{if $company_name}{$company_name}{else}{$company_id|fn_get_company_name}{/if}</a></span>
        {/hook}
    </div>
{/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"}
    <div class="ty-control-group{if !$capture_options_vs_qty} product-list-field{/if}">
        {hook name="companies:product_company_data"}
            <label class="ty-control-group__label">{__("vendor")}:</label>
            <span class="ty-control-group__item ty-company-name"><a href="{"companies.products?company_id=`$company_id`"|fn_url}"
 
 
 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}</a></span>
 
 
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 



 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 11762 posts

Posted 27 July 2020 - 09:53 PM #17

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.


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • saltwater
  • Advanced Member
  • Members
  • Join Date: 14-May 20
  • 108 posts

Posted 27 July 2020 - 09:57 PM #18

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 



 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 11762 posts

Posted 27 July 2020 - 10:30 PM #19

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.


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • saltwater
  • Advanced Member
  • Members
  • Join Date: 14-May 20
  • 108 posts

Posted 27 July 2020 - 10:33 PM #20

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 !