PluginUs.Net - Business Tools for WooCommerce and WordPress

[realize your idea - make your dreams come true]

Support Forum

You need to log-in to create request (topic) to the support

URL link to product attribute - version 2

The support doesn work on Saturdays and Sundays, so some Friday requests can be answered on Monday. If you have problems with registration ask help on contact us page please
If you not got email within 24~36 business hours, firstly check your spam box, and if no any email from the support there - back to the forum and read answer here. DO NOT ANSWER ON EMAILS [noreply@pluginus.net] FROM THE FORUM!! Emails are just for your info, all answers should be published only here.
The support doesn work on Saturdays and Sundays, so some Friday requests can be answered on Monday.

Hi (like the support ticket before this one), I am also trying to add a hyperlink to a text field as a product attribute to a Product in WooCommerce and show that field in my WOOT Table.
The product attribute is to be a hyperlink to a PDF file which is a manual for the product.

Here is the content I placed in the WooCommerce Attribute;
<a href="https://www.crosshydraulics.com.au/wp-content/uploads/2022/05/Valves_Mechanical_and_Solenoid_Cartridge_Valves_Delta_Cartridge_Valves_Mechanical_Pressure_Controls_Relief_DE-RVA_DERVA.pdf" target="new">SPEC PDF</a>

However the resulting hyperlink in my WOOT table is;
https://www.crosshydraulics.com.au/specsheet/spec-pdf/

Results page:
https://www.crosshydraulics.com.au/product/cvm-pc-relief/

Another example is the link: https://www.crosshydraulics.com.au/wp-content/uploads/2022/05/Valves_Mechanical_and_Solenoid_Cartridge_Valves_Delta_Cartridge_Valves_Mechanical_Pressure_Controls_Relief_DE-RVA_DERVA.pdf
Changes to: https://www.crosshydraulics.com.au/specsheet/https-www-crosshydraulics-com-au-wp-content-uploads-2022-05-valves_mechanical_and_solenoid_cartridge_valves_delta_cartridge_valves_mechanical_pressure_controls_relief_de-rva_derva-pdf/

In the SPEC Column all the links are wrong, how can this be fixed?

Regards

Mark

Hello Mark

Its doing in another way:

_my_txt_link - is just an example, you can name meta key as you want but do not use spaces!

Hi and thank you for your prompt reply Elisio

I purchased the full version of the Bulk Editor (I hope that helps support you guys for the good work you do).
I did as above and that worked perfectly.

There would be two further requests please.
1. How can I make the links open in a new window?
2. Currently on my WOOT table - the column I have setup displays 'SPEC PDF' in each row even if there is no link entered (if no manual link has been added it links to a product URL). Is it possible to show nothing unless an entry has been made?

Again, your help is greatly appreciated.

Regards

Mark

Hello Mark

Thank you :)

Here is the code:

add_action('woot_meta_data_cell', function ($value, $meta_data, $post_id, $table_id) {

if (!empty($value)) {
if ($meta_data['meta_key'] === '_my_txt_link'/* AND $table_id === 21 */) {
$value ="<a href='{$value}' target='_blank'>SPEC PDF</a>";
}
}

return $value;
}, 10, 4);


In new version of the code is going value check, so if field is empty nothing to display, and also to open pdf document in new window into link added attribute _target with its value '_blank'

I hope this version will help you ...