Ive noticed that someone already made a post on this just under 12 months ago but no reply.
However I am quite interested in this, how would you go about displaying certain products outside of opencart, such as on another website? Is it possible?
Thank you
However I am quite interested in this, how would you go about displaying certain products outside of opencart, such as on another website? Is it possible?
Thank you
You could use an RSS feed or you could just connect directly to the DB and grab the items you need.
This one shows the latest products:
http://www.opencart.com/index.php?route ... on_id=1540
This one lets you create one for categories, specials or brands:
http://www.opencart.com/index.php?route ... on_id=3949
This one shows the latest products:
http://www.opencart.com/index.php?route ... on_id=1540
This one lets you create one for categories, specials or brands:
http://www.opencart.com/index.php?route ... on_id=3949
OpenCart Extensions, Technical Support & Custom Development | Have I helped you?
Hi d7a7z7e7d,
Thanks for your reply, I might go with that RSS feed to be honest, it seems like the easiest, and most efficient route, plus I get to help out UKSB a little bit for his efforts.
I have emailed him asking to enable that RSS feed on his demo store so I can check it out so fingers crossed.
Just incase that is not really what Im looking for, do you know anything about SQL, im not to great with it myself. I know how to connect to the database and I do have an idea of how to grab things from it but im a little stuck on how to do it with opencart.
You see, I dont want to grab all items from the DB, only products from a specific category. Could you or anyone point me in the right direction with a spot of code please?
Thank you for advice
Thanks for your reply, I might go with that RSS feed to be honest, it seems like the easiest, and most efficient route, plus I get to help out UKSB a little bit for his efforts.
I have emailed him asking to enable that RSS feed on his demo store so I can check it out so fingers crossed.
Just incase that is not really what Im looking for, do you know anything about SQL, im not to great with it myself. I know how to connect to the database and I do have an idea of how to grab things from it but im a little stuck on how to do it with opencart.
You see, I dont want to grab all items from the DB, only products from a specific category. Could you or anyone point me in the right direction with a spot of code please?
Thank you for advice
Good news, I found an extension for a RESTful API, which would be the proper way to go about this. It's a little bit bare-bones but it does come with some sample functions like getProducts() and looks like it's exactly what you'd need, with some minor modifications. Check it out:
http://opencart.hostjars.com/opencart-rest-api
Basically you'll just need to write a getProductsByCategory() function, which I could help you with, and then you'd just access the data by cURLing the URL: http://www.example.com/index.php?route= ... ByCategory
http://opencart.hostjars.com/opencart-rest-api
Basically you'll just need to write a getProductsByCategory() function, which I could help you with, and then you'd just access the data by cURLing the URL: http://www.example.com/index.php?route= ... ByCategory
OpenCart Extensions, Technical Support & Custom Development | Have I helped you?
With this query (you can customize easily) you'll be getting 10 latest products from store_id 0, category 230, manufacturer 17 with "keyword" to build nice SEO friendly links to your store.
Code: Select all
SELECT `oc_product`.`product_id`,`name`,`description`,`image`,`keyword`FROM `oc_product`
LEFT JOIN `oc_product_to_category`
ON `oc_product_to_category`.`product_id` = `oc_product`.`product_id`
LEFT JOIN `oc_product_description`
ON `oc_product_description`.`product_id` = `oc_product`.`product_id`
LEFT JOIN `oc_product_to_store`
ON `oc_product_to_store`.`product_id` = `oc_product`.`product_id`
LEFT JOIN `oc_url_alias`
ON (`oc_url_alias`.`query` LIKE CONCAT('%',`oc_product`.`product_id`,'%'))
WHERE `oc_product_to_category`.`category_id` = '230' AND `oc_product`.`status` = '1' AND `oc_product`.`date_available` <= NOW() AND `oc_product`.`manufacturer_id`='17' AND `oc_product_to_store`.`store_id` = '0'
ORDER BY `oc_product`.`product_id` DESC LIMIT 10
Pedro Martin - websitesbuilder.com.au
Checkout my free extensions: https://www.opencart.com/index.php?rout ... r=comprido
In order for that to happened, the remote platform on the same domain must either use PHP PDO which can take a great amount of socket resources between environments, or maintain the same database resource (less suggested unless using a dedicated fully managed server). Alternatively, the data could be feed by using the same catalog model product: viewtopic.php?f=202&t=220903#p805005 .comprido wrote: ↑Sat Sep 04, 2021 6:34 pmWith this query (you can customize easily) you'll be getting 10 latest products from store_id 0, category 230, manufacturer 17 with "keyword" to build nice SEO friendly links to your store.
Code: Select all
SELECT `oc_product`.`product_id`,`name`,`description`,`image`,`keyword`FROM `oc_product` LEFT JOIN `oc_product_to_category` ON `oc_product_to_category`.`product_id` = `oc_product`.`product_id` LEFT JOIN `oc_product_description` ON `oc_product_description`.`product_id` = `oc_product`.`product_id` LEFT JOIN `oc_product_to_store` ON `oc_product_to_store`.`product_id` = `oc_product`.`product_id` LEFT JOIN `oc_url_alias` ON (`oc_url_alias`.`query` LIKE CONCAT('%',`oc_product`.`product_id`,'%')) WHERE `oc_product_to_category`.`category_id` = '230' AND `oc_product`.`status` = '1' AND `oc_product`.`date_available` <= NOW() AND `oc_product`.`manufacturer_id`='17' AND `oc_product_to_store`.`store_id` = '0' ORDER BY `oc_product`.`product_id` DESC LIMIT 10
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Who is online
Users browsing this forum: No registered users and 186 guests