Sha256: 92df2fa577f18dbc94a09be3b621f0ca4752a5ce3d43af282117f83de75be209

Contents?: true

Size: 546 Bytes

Versions: 1

Compression:

Stored size: 546 Bytes

Contents

module Gemgento
  class Magento::ProductAdapter
    include MagentoAdapter

    def self.find_by(attributes)
      response = Gemgento::API::SOAP::Catalog::Product.list filters(attributes)

      if response.body_overflow[:store_view].first[:item]

        if response.body_overflow[:store_view].first[:item].is_a? Array
          return response.body_overflow[:store_view].first[:item].first

        else
          return response.body_overflow[:store_view].first[:item]
        end

      else
        return nil
      end
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
gemgento-2.8.0 app/adapters/gemgento/magento/product_adapater.rb