Get Product URL from Supplier Info

Daniel0118

New Member
Hi,

I'm doing a few customisations and just wanted to know if there is an easy way to retrieve the Product URL from Supplier Info. (To be clear this is the URL of the item on ALIexpress)

Thanks,
Daniel
 

Attachments

  • product url.png
    product url.png
    6.4 KB · Views: 43

Daniel0118

New Member
Hi Victoria,

I want to use the product link (to aliexpress) on the product page.
I am using a hook to display additional information after the add to cart button.

I can access the product id with this:

global $product;
$id = $product->get_id();

Can I access the Product URL as shown in my screenshot?

I appreciate your help.

Thanks,
Daniel
 

Christian123

New Member
Hi Daniel,
did you found a solution?
I need to open the product page on aliexpress from my dashboad.
But I don't know how to find the URL to the Aliexpress Site....
Some Help would be good.
Thank you.Christian

Solved!
under the product variation is the link. :)
 
Last edited:

Daniel0118

New Member
Hey Christian,

Glad you found it in there. I am trying to get it for use on the front end.

Victoria:
On that note the second part of what I am trying to do is attach my affiliate code (admitted) to it.
I think this is already a backend feature of AliDropship so if it is easy enough could you point me in the direction of that piece of code for use in a snippet hooked into the front end.

Again I appreciate your time.

Thanks,
Daniel
 

Victoria Kudryashova

Administrator
Hi Victoria,

I want to use the product link (to aliexpress) on the product page.
I am using a hook to display additional information after the add to cart button.

I can access the product id with this:

global $product;
$id = $product->get_id();

Can I access the Product URL as shown in my screenshot?

I appreciate your help.

Thanks,
Daniel
You can do this via request to database . But these changes you will make don't be saved after update.
 

Daniel0118

New Member
Hi Future Readers,

In case anyone is ever looking for this information here is the code that works:

** This is amateur code so please feel free to improve it **

global $wpdb;
global $product;

$prod = $product->get_id();

$result = $wpdb->get_results ( "
SELECT productUrl
FROM wp_adsw_ali_meta
WHERE post_id = '$prod'
" );

** This is amateur code so please feel free to improve it **

Thanks,
Daniel
 
Top