Jump to content

Recommended Posts

Posted

I guess the problem lies on database naming: ShoppingCart vs. shoppingcart

That actually was the problem apesia.Thanks a lot ! ..But what actually shocks me is how that worked on the local machine in the first place.The table names come from :

$update = $this->db->query("UPDATE {$this->className} SET items = '$items', total_sum = $total_sum WHERE session_id = '" . $this->getSession() . "'");
class ShoppingCart extends WireData implements Module, ConfigurableModule
Posted

Delving deeper in the module code

CREATE TABLE {$this->className} (
			session_id VARCHAR(255) NULL,
			last_modified TIMESTAMP NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
			items TEXT NULL,
			total_sum FLOAT(10,2) NULL,
			user_id INT NULL,
			PRIMARY KEY (`session_id`) )
class ShoppingCart extends WireData implements Module, ConfigurableModule

it turns for that this code creates a table with name 'shoppingcart' instead of 'ShoppingCart' when run on my local wamp machine, but when run directly on my server xamp it creates 'ShoppingCart'.

And i got the problme because i ported from my local to server machine, so carried 'shoppingcart' table , which when called on local machine worked surprsiingly for some reason but on server its case-sensitive.

  • Like 1
Posted

I'm now trying to add a country field to the checkout page. I've checked the 'Use Country field' and 'Is Country required' boxes on the Shopping Checkout module admin page, but they're not appearing in the rendered form.

I tried turning off the City fields as a test and this worked fine.

Posted

Thanks Soma, that's the ShoppingOrdersManagement module which I will be needing, but my current problem is with the Checkout module. I don't think you've changed that in your version - does that mean it should be working as is?

Edit: Oh, just saw your edit.

Posted

It should be working as I'm using it in various shops. Maybe you changed to add the country while you already testing, and the fields are saved in session.

  • 1 month later...
Posted

I need some help, how to get price value from custom template. Is price value getting back from protected methods or ?
If somebody have some example how to view price from sc_price field on custom page template?
Thanks

Posted

Hi Danijel and welcome to PW. I haven't used the shop module yet, but I think what you are probably looking for is something like this:

$product->sc_price

So now of course you need to define $product.

From looking around I think this should work:

foreach ( $page->children as $product ) {
    echo $modules->get( "ShoppingCart" )->renderPrice( $product->sc_price );
}
Posted

Adrian, thanks a lot! Its work , I looking for solution to native get custom fields values not through shopping cart module. If someone can explain me how to get values through API $fields.
Best regards, and good wishes to supports this good work in the future :)

Posted

Danijel,

If I understand what you mean, then it's simply:

foreach ( $page->children as $product ) {
    echo $product->sc_price;
}

The renderPrice function included in the shop module (https://github.com/apeisa/Shop-for-ProcessWire/blob/e27eb462502feecca085db82d3183204b2925850/ShoppingCart.module#L278) is just there to format the price, it is not needed at all to get the price for the product.

Not sure how far along you are in your PW learning process, but the $page->children foreach is only relevant if you are on a page with multiple child pages as products. If you are on a single product child page already, then you might simply want this:

echo $page->sc_price;

Remember that $page refers to the current page being viewed, so in this case you are asking for the sc_price field for the current page.

Hope that helps.

  • 2 weeks later...
Posted

Is there an official topic? Can't seem to find it... :-)

I find a lot of others...

Seems I got an error

Error: 
Call to a member function getModuleInfo() on a non-object (line 229 of /processwire/site/modules/ShoppingCheckout.module) 

Grtz

Posted

No there is no official topic, though there was one started long time ago but can't find. Also it's pretty much a "beta" WIP.

Anyway you may consider also adding an issue on github since there's an official repository.. https://github.com/apeisa/Shop-for-ProcessWire/issues?page=1&state=open

Looks like you have a problem with Payment module, have you any installed? The error does indicate there's not payment module.

Posted

Thx for the answer...

I've added an issue on github.

I have a payment module installed: PaymentPaypal.module

since it's the only one I need [at the moment].

Weird thing: it doesn't show up all the time, just now and then, I've tried to trigger it but somehow I can't... and then suddenly 'boom' there it is... very weird

Posted

The payment module is stored in session , so there might be an issue on your side. I use the shop in many projects and never had an issue with that.

Posted

After all there's some quirks and stuff not coded very well. I have forked the shop module some time ago and fixed/changed minor things. I'm not sure what causing your error exactly, but seems as the session sometimes isn't set correct when the form wasn't valid or so.

You could try my version of the shop module, it's the dev version that has some changes there.

https://github.com/somatonic/Shop-for-ProcessWire/tree/dev

Although there's more changes and additions in this version, but should be compatible and not less unstable than the apeisa version.

  • Like 2
Posted

Any videos to see the shop backend or payment options?

I think I have to install me a testing instance to see how it works...

Maybe I build a little shop with paypal and invoice payment options.

Looked at some shops build with that module before, but wouldn't order any products to see it work *g*

  • 3 weeks later...
Posted

trying to create my first shop and finding the steps in the readme abit sparse.

was able to add a price / qty and rendered in a template but the $modules->get("ShoppingCart")->renderAddToCart(); doesnt seem to render anything. anyone had this issue?

Posted

struggling to get this module up and running, be great if someone recorded a screen cast or wrote a idiots guide (will do a screencast if I happen to work it out)

Posted

item template

include("./head.inc");

echo $page->body;
echo $page->sc_price . "\n";
echo $page->sc_qty . "\n";

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

$modules->get('ShoppingCart')->getNumberOfItems();
$modules->get("ShoppingCart")->renderCart();

include("./foot.inc");

Gives me the price and qty but nothing else

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
  • Recently Browsing   0 members

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