Module: ProductCardHelper

Defined in:
app/helpers/product_card_helper.rb

Overview

View helper: product card.

Instance Method Summary collapse

Instance Method Details

#product_card_for_product(product, options = {}) ⇒ String

Renders the SKU product card partial for a product.

Parameters:

  • product (Product)

    the product to render

  • options (Hash) (defaults to: {})

    options forwarded as the options local to the _sku_card partial

Options Hash (options):

  • col_size (String)

    Bootstrap column classes (defaults to 'col-12 col-sm-4')

  • simple_card (Boolean)

    center the card header

  • show_price (Boolean)

    show the product price

  • show_discounted_price (Boolean)

    show the discounted price block

  • original_price (String)

    rendered original price

  • discounted_price (String)

    rendered discounted price

  • hide_cta (Boolean)

    hide the call-to-action button

Returns:

  • (String)

    the rendered partial HTML



15
16
17
# File 'app/helpers/product_card_helper.rb', line 15

def product_card_for_product(product, options = {})
  render partial: '/www/product_cards/sku_card', locals: { product: product, options: options }
end