Hi all
I have a question - how I can import buy_now_url from csv file in cataloc mode?
Thanks
I have a question - how I can import buy_now_url from csv file in cataloc mode?
- Create the app/addons/my_changes/schemas/exim/products.post.php file with the following content:
<?php
$schema['export_fields']['Buy Now URL'] = array(
'db_field' => 'buy_now_url'
);
return $schema;
- Install the My Changes module
- Clear the cache
- Check the result
The default Buy Now button in cataloge mode opens the external urls in the same window. Is it possible to open the link in new window.
design/themes/THEME/templates/addons/catalog_mode/hooks/buttons/add_to_cart.override.tpl
replace
{include file="buttons/button.tpl" but_id=$but_id but_text=__("buy_now") but_href=$product.buy_now_url but_role=$but_role|default:"text" but_meta="ty-btn__primary" but_name=""}
with
{include file="buttons/button.tpl" but_id=$but_id but_text=__("buy_now") but_href=$product.buy_now_url but_role=$but_role|default:"text" but_meta="ty-btn__primary" but_name="" but_target="_blank"}
and clear cache then
design/themes/THEME/templates/addons/catalog_mode/hooks/buttons/add_to_cart.override.tpl
replace
{include file="buttons/button.tpl" but_id=$but_id but_text=__("buy_now") but_href=$product.buy_now_url but_role=$but_role|default:"text" but_meta="ty-btn__primary" but_name=""}with
{include file="buttons/button.tpl" but_id=$but_id but_text=__("buy_now") but_href=$product.buy_now_url but_role=$but_role|default:"text" but_meta="ty-btn__primary" but_name="" but_target="_blank"}and clear cache then
Thanks for update but still when you click on Buy now button the external url loads in same page.
The link generated in buy now button does not contain (target"_blank").
It contains link as <a href="<a data-ipb='nomediaparse' href='http://www.xxx.com'>http://www.xxx.com" class="ty-btn ty-btn__primary " >Buy now
Thanks for update but still when you click on Buy now button the external url loads in same page.
The link generated in buy now button does not contain (target"_blank").
It contains link as <a href="<a data-ipb='nomediaparse' href='http://www.xxx.com'>http://www.xxx.com" class="ty-btn ty-btn__primary " >Buy now
Did you clear cache?
Did you clear cache?
yes cache was already cleared.
It should work. Try to delete the var/cache directory manually
It should work. Try to delete the var/cache directory manually
Yes, it is working now.
Thank you so much for your time and efforts.
YPG
You are welcome!
how this operation can add the filed with the url of the product to import preset… cause is not there
It should work. Do not froget to clear cache then
… to work IMPORT… how is the name of the topic,
at new preset import i suppose to have the choice to associate my field URL with “buy_now…” or how si define in cs-cart… like all mapping at the import…
Yes, if you add this field to schema, it should be available in the fields mapping in the import presets
… maybe i dont know how to proceed with this…
even after clear cache, delete all folders from var/cache…
still field to import dosent appear on preset import, not on old import
logically must be something like this:
<?php $schema['import_fields']['Buy Now URL'] = [ 'db_field' => 'buy_now_url', 'process_put' => ['fn_exim_import_field_value', '#this'], ]; return $schema;but still even with this, there is not new field, or difference, not in preset or in old importing
This code will be enough to add import of the buy_now_url
field via products.post.php schema.
<?php
$schema['export_fields']['Buy now url'] = [
'db_field' => 'buy_now_url',
];
return $schema;