Jump to content

Display Featured Product Feed on another site


Imajica929

Recommended Posts

Welcome Imajica929! Glad to see you made it to the forums.

CubeCart does not have an externally accessible API that would return this data, but one could be built.

We would have to assume that you already have the capability and skill to write the blog's request and consume the returned data.

On the other hand, if you can convince the blog to access CubeCart's database directly, all the pertinent data could be queried independently.

 

Link to comment
Share on other sites

CubeCart's "Featured" is actually a random pick from all products whose featured flag is set. Modify the following query to have the database engine pick one random record -or- only have set one product's Featured setting checkbox to a checked state.

SELECT * FROM `CubeCart_inventory` WHERE CubeCart_inventory.status = '1' AND CubeCart_inventory.featured = '1';

Take note of the 'product_id' of the returned row. Use it in the next two queries.

SELECT `path` FROM `CubeCart_seo_urls` WHERE CubeCart_seo_urls.type = 'prod' AND CubeCart_seo_urls.item_id = $product_id;
SELECT `file_id` FROM `CubeCart_image_index` WHERE CubeCart_image_index.product_id = $product_id ORDER BY `main_img` DESC LIMIT 1;

Take note of the 'file_id' of the returned row. Use it in the next query.

SELECT `filepath`, `filename` FROM CubeCart_filemanager WHERE CubeCart_filemanager.file_id = $file_id;

Use 'filepath' and 'filename' to construct an <img> tag for the product's image.

Use 'path' to construct a web address to the product in the CubeCart store.

 

Link to comment
Share on other sites

I'll admit it.. I cheated.. a lot

I made a copy of index.php and changed the display to 'templates/box.featured.php'

I can run that in a iframe or call it from an include with some additional massaging

 

I'll play with the database method after we go live and I have a little more time :)

 

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...