eyoung
eyoung

Reputation: 1

Pulling Featured BigCommerce Products into Separate Site

We have a website that's built in Drupal 7 and the site's store is being handled via BigCommerce.

With the BigCommerce API, would it be possible to pull in featured products to display in a sidebar on the Drupal site? At most it'd be the product title, image, price, and then it would link over to the full product page on BigCommmerce.

Upvotes: 0

Views: 111

Answers (2)

Gilad Zirkel
Gilad Zirkel

Reputation: 26

Bigcommerce supplies RSS / ATOM feeds for "Featured products" (and many more)

From Bigcommerce support:

LATEST 10 FEATURED PRODUCTS:

Upvotes: 0

thannes
thannes

Reputation: 778

Not the "best" way, but can be done in 10 minutes... Write some AJAX to grab the featured products HTML from your BigCommerce site and insert them on your Drupal site's sidebar.

Clone this node proxy repo and host your own version on heroku for free in 5 minutes... This will allow you to make cross origin requests using AJAX and pull in the div or divs you need on your Drupal site in a short time. Seems like overkill to me to fetch from BC API for such a small feature.

Code

jQuery.ajaxPrefilter(function(options) {
    if (options.crossDomain && jQuery.support.cors) {
        options.url = 'YOUR OWN HOSTED PROXY APP URL HERE' + options.url;
    }
});
$.get(
    'BC PAGE URL HERE',
    function (response) {
        MANIPULATE DOM HERE WITH RESPONSE DATA
        $('.home-list').html($(response).find('#content').html());
});

Upvotes: 1

Related Questions