getgrav / grav-skeleton-shop-site

Grav Shop Site Skeleton
https://getgrav.org
MIT License
17 stars 12 forks source link

Master #1

Closed paulvanderschee closed 8 years ago

paulvanderschee commented 8 years ago

Dear grav developers, Is it possible to tweak the snipcart module to reference a external product item as well. Like this example: howtoroutecorrectly

The specific file which need to be edited in this case is: https://github.com/getgrav/grav-plugin-snipcart/blob/develop/templates/partials/snipcart_detail_item.html.twig the following code:

`<a href="#" class="button snipcart-add-item" data-item-id="{{ page.header.product_id }}" data-item-name="{{ page.header.title }}" data-item-price="{{ page.header.price }}" data-item-url="{{ page.url }}"

Add to Cart ` the variable: page.url variable should be an external custom url variable which should get customized in the frontmatter with any custom link from the product item page.

and the same for: https://github.com/getgrav/grav-plugin-snipcart/blob/develop/templates/partials/snipcart_product_item.html.twig

`{{ page.header.title }}

{% if snipcart_image %} {{ snipcart_image.cropResize(200,200).html('page.header.title','snipcart-thumb-image') }} {% endif %} ${{ page.header.price }}
<div class="snipcart-details">
<p>
    <a href="{{ page.url }}"
        class="button button-small">
        <i class="fa fa-info-circle"></i> Details
    </a>
    <a href="#"
        class="button button-small snipcart-add-item"
        data-item-id="{{ page.header.product_id }}"
        data-item-name="{{ page.header.title }}"
        data-item-price="{{ page.header.price }}"
        data-item-url="{{ page.url }}"
    >
        <i class="fa fa-shopping-cart"></i> Add
    </a>

`

the variable: page.url and # variable should be an external custom url variable which should be able to get customized with any custom link in the frontmatter from the grav product item page.

For now it is not possible for me to tweak this to any custom url from the frontmatter. I worked on a mac computer, and used the http://demo.getgrav.org/shop-skeleton/shop/geek-toys/ia449-brick-mug + Grav core + Admin plugin.

Greetings Paul