-
Posts
358 -
Joined
-
Last visited
Everything posted by Tyssen
-
Updating checkbox field based on values from repeater field
Tyssen replied to Tyssen's topic in API & Templates
Never mind, realised my problem about 30 seconds after posting. :/ Mods can close this thread. -
Updating checkbox field based on values from repeater field
Tyssen posted a topic in API & Templates
I'm using a repeater field for holding stock levels of different items and when all the rows' quantity columns equal 0, I want to set another stock checkbox field to off. I'm doing this in the template that displays the product: foreach($page->inventory as $stock) : $stock_total += $stock->qty; if($stock_total==0) : $page->of(false); $page->stock = false; $page->save(); endif; endforeach; but it's setting $page->stock to off whenever the page is refreshed regardless of whether $stock_total = 0 or not. Why is that? -
Actually what I needed is sort=parent,sort=sort but thanks for pointing me in the right direction. I didn't see any mention of anything like that in the docs or in searching the forum.
-
I have a series of products which are attached to 'collections' which are their parent pages. I need to be able to output the products by their parents order. At the moment I have this: $products = $pages->find("template=product,stock=1"); which worked fine when I first created the site because all the products were entered in the correct order, but now a new collection has been added that needs to go first. (Parent pages have a different template than the individual products.) I've tried adding sort=sort but as mentioned in the docs it doesn't really produce the desired result. So how would I go about it?
-
I decided to give it a go myself after all and now have it working fine. I ended up in doing it in a template instead of creating a module as you suggested.
-
The main issue is, if I do this myself, I have no idea how long it would take me to do as I'd be learning as I go and I have to give the client a price before I can even start. Would feel more comfortable speaking to someone who can accurately estimate up front.
-
I was hoping that this being the jobs forum, that someone might get in contact about taking on the job for me (paid of course). But if no-one does I'll have to explore other options.
-
I'm stuck at the 'never having written a module and not really having the skills to do so' part. If you look at the blog post I've linked to, a webhook which points at some code on your site is fired from within SnipCart on the order.completed event.
-
Sorry, just realised I wrote my original post with I'm using a repeater field with each row containing a size column instead of quantity column, so yeah, managing inventory in PW.
-
I have a PW site which is integrated with Snipcart and now the owners want to add stock management. Because each item comes in different sizes and colours, I'm using a repeater field with each row containing a size column. The guys at Snipcart have written a blog post on how to achieve basically what I need in a plugin for Craft CMS. I need that converted into a module for PW and instead of updating an individual field, it's updating a column in a repeater field. Anyone able to help me out with that?
-
Same URL as I'm already on. Same result except that with a URL field I can't remove the http/s so always get an error. At least as a text field I have the option of leaving it out and putting the protocol in the template. Doesn't appear to be although there are several suhosin modules that are turned on.
-
All the fields under the files tab for the relevant template are blank. No $config values exist for prepend/appendTemplateFile and admin.php contains: <?php /** * Admin template just loads the admin application controller, * and admin is just an application built on top of ProcessWire. * * This demonstrates how you can use ProcessWire as a front-end to another application. * * Leave this file as-is, do not remove. * */ require($config->paths->adminTemplates . 'controller.php'); I've tried editing a couple of other pages that use different templates and they've saved OK, so it's only this one, which I added some new fields to last week, and which was fine when I made those updates, which is now throwing this error.
-
Released: PadLoper (commercial eCommerce platform for ProcessWire)
Tyssen replied to apeisa's topic in Modules/Plugins
Reading this thread it seems a few have got their hands on it already. Is that through a private invited beta or are people getting access some other way? I signed up to the newsletter but I don't think I've had any emails since then. -
Unfortunately, that doesn't help. I get the error whether I use size(), width() or height(). And if I move ->url to another line, the error message still points at the line where size, width or height is first called. Yes, all these images already exist on disk, as they were created when the site was first in development and everything was working fine.
-
I'm doing some updates on a site that only just launched last week and during development everything was fine. But now I've exported the db from the production site, imported it back into my local and get Call to a member function size() on a non-object. My template looks like: foreach($products as $product) : $img_src = $product->images->first(); echo $img_src; // this works echo $img_src->url; // so does this echo $img_src->size(300,300)->url; // this gives me the error endforeach; What would be causing this to error now when it was working fine before and I can get values for the image and its source, just not the resized version?
-
Hi Pete, is there an official version of this module which has been updated to work with Twitter's latest OAuth version?
-
Fieldtype for selecting images from another field on same page
Tyssen replied to Tyssen's topic in General Support
I'm testing out a PageTable field with ImagesSelect and can now see the + button but I'm having trouble displaying data on the front end to test the output. I thought I could do: foreach($page->pageTableField as $field) : echo $field->title . '<br>' . $field->description . '<br>'; endforeach; But I get no output. If I just do: echo $page->repeaterField I get a list of pipe-separated ID numbers. But if I do: echo $page->pageTableField I get nothing. I can see in the db that the data for the pageTable field is a single ID corresponding to the new page that's been created. So am I doing something wrong? -
OK, thanks, I'll look into that.
-
That's currently set to 1000. The page has a table fieldtype of 8 column with 99 rows and a few other inputs so ~800 which is why I didn't think it would be the issue. But I tried increasing the limit to 2000 and resaved, and got the same result.
-
Saving the same entry on my local version of the site is fine so that's probably it. But I've tried increasing post_max_size to 32 up from 8 but the problem remains. I don't think it's an execution time problem because the page goes to 404 within a couple of seconds of submitting the form.