apeisa Posted May 4, 2014 Share Posted May 4, 2014 I guess the problem lies on database naming: ShoppingCart vs. shoppingcart 1 Link to comment Share on other sites More sharing options...
dev123 Posted May 5, 2014 Share Posted May 5, 2014 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 Link to comment Share on other sites More sharing options...
dev123 Posted May 5, 2014 Share Posted May 5, 2014 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. 1 Link to comment Share on other sites More sharing options...
Pablos Posted May 6, 2014 Share Posted May 6, 2014 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. Link to comment Share on other sites More sharing options...
Soma Posted May 6, 2014 Share Posted May 6, 2014 I fixed this country field on my Shop Version here https://github.com/somatonic/Shop-for-ProcessWire/commit/246ed23a399e1f086084840231b3076784ad7221 but apeisa's is older. Edit: Ok that commit wasn't it but I remember fixing something with country field some time ago. Link to comment Share on other sites More sharing options...
Pablos Posted May 6, 2014 Share Posted May 6, 2014 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. Link to comment Share on other sites More sharing options...
Soma Posted May 6, 2014 Share Posted May 6, 2014 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. Link to comment Share on other sites More sharing options...
Pablos Posted May 6, 2014 Share Posted May 6, 2014 That did it! Thanks once again for your help Soma. Link to comment Share on other sites More sharing options...
Danijel Posted June 10, 2014 Share Posted June 10, 2014 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 Link to comment Share on other sites More sharing options...
adrian Posted June 10, 2014 Share Posted June 10, 2014 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 ); } Link to comment Share on other sites More sharing options...
Danijel Posted June 11, 2014 Share Posted June 11, 2014 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 Link to comment Share on other sites More sharing options...
adrian Posted June 11, 2014 Share Posted June 11, 2014 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. Link to comment Share on other sites More sharing options...
videokid Posted June 19, 2014 Share Posted June 19, 2014 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 Link to comment Share on other sites More sharing options...
Soma Posted June 20, 2014 Share Posted June 20, 2014 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. Link to comment Share on other sites More sharing options...
videokid Posted June 20, 2014 Share Posted June 20, 2014 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 Link to comment Share on other sites More sharing options...
Soma Posted June 20, 2014 Share Posted June 20, 2014 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. Link to comment Share on other sites More sharing options...
Soma Posted June 20, 2014 Share Posted June 20, 2014 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. 2 Link to comment Share on other sites More sharing options...
videokid Posted June 20, 2014 Share Posted June 20, 2014 OK, nice! so I can just overwrite them? Not uninstall .. install.... Link to comment Share on other sites More sharing options...
pwFoo Posted June 27, 2014 Share Posted June 27, 2014 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* Link to comment Share on other sites More sharing options...
benbyf Posted July 12, 2014 Share Posted July 12, 2014 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? Link to comment Share on other sites More sharing options...
Soma Posted July 12, 2014 Share Posted July 12, 2014 Can you show your code? Do you echo ... ? Link to comment Share on other sites More sharing options...
benbyf Posted July 12, 2014 Share Posted July 12, 2014 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) Link to comment Share on other sites More sharing options...
benbyf Posted July 12, 2014 Share Posted July 12, 2014 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 Link to comment Share on other sites More sharing options...
Soma Posted July 12, 2014 Share Posted July 12, 2014 Where is the echo? Link to comment Share on other sites More sharing options...
benbyf Posted July 12, 2014 Share Posted July 12, 2014 ah, thats the issue. sorry been used to not echo'ing when referring to a modules markup. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now