Jump to content

Shop-for-Processwire compatibility


Guy Verville
 Share

Recommended Posts

I am using this module with 2.5.10 dev version and i see 1 issue for updating current cart not working, maybe it causing from my mods. I have some modifications for form validations and call custom view files. 

Link to comment
Share on other sites

  • 1 month later...
  • 4 weeks later...

Hello,

I installed the shop-module.

- Adding the sc_price and sc_qty to my product-template.

post-3100-0-64796000-1424339676_thumb.pn

The product-template has no template-file, because I made a (parent) list products.php

This list works, also displays the 'sc_price' for each product.

post-3100-0-51899700-1424339675_thumb.pn

I mean this code below generates a 'buy'-button?

echo $modules->get("ShoppingCart")->renderAddToCart();

I put this in my products.php template:

<?php
      	$products = $pages->find("template=product");
      	foreach($products as $product) {
            echo "<h3>{$product->title}</h3>";
            echo "<p>{$product->sc_price}</p>";
            echo $modules->get("ShoppingCart")->renderAddToCart();
        };
?>

But it don't show a 'buy'-button or whatever  ???

Sorry, i'm a newbie, what do i wrong?? Who can help me?  :undecided:

Is there a good tutorial with screenshots or video-tutorial how setup this modules(s)?

At this moment only the ShoppingCart-module is installed.

Grtz,

Christophe

Link to comment
Share on other sites

Pass the product to renderAddToCart:

echo $modules->get("ShoppingCart")->renderAddToCart($product);

The method tries to use the current page as the product page for which to render the button if none is passed as its argument, but since you're calling it from a non-product page without an sc_price field, it doesn't find anything to render.

  • Like 1
Link to comment
Share on other sites

Pass the product to renderAddToCart:

echo $modules->get("ShoppingCart")->renderAddToCart($product);

The method tries to use the current page as the product page for which to render the button if none is passed as its argument, but since you're calling it from a non-product page without an sc_price field, it doesn't find anything to render.

Hi BitPoet,

Thanks for your advice.

I try it!

Regards,

Christophe

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...