Jump to content

sarah_hue

Members
  • Posts

    29
  • Joined

  • Last visited

Everything posted by sarah_hue

  1. Copied everything to a separate webserver. Uploading files, deleting them and changing their description works fine here. Anything you could suggest instead of deinstall and reinstall the VersionControl module?
  2. Well, instead of counting the number of free seats every time a tour page is viewed, I would recalculate the number of free seats (and update the field) once a new booking is made. But maybe that's exactly what you were planning to do and I just misunderstood it.
  3. Jon, indeed the easiest way would be a field (i.e. 'free_seats') on each tour page (= child page of a tour date). Then you would use something like: public function calculateFreeSeats(Page $tour, $order) { if ($tour->free_seats) { $tour->setOutputFormatting(false); $tour->free_seats = ($tour->free_seats - $order->seats); $tour->save(); } }
  4. sarah_hue

    von Bergh

    With everybody else discussing performance: I like the one-page construction very much, and when it comes to neat little details like the imprint fly-in animation the design really convinces me. (Though I'm usually not a fan of one-page-sites!) The many, many references are clearly arranged and especially the different categories of references are beautifully implemented. Well done, Andreas! The only obstacle I found was the long way I needed to scroll down once I clicked on details of the very last references - since that flies me directly to the upper content area, with no link to get back to the end of the list. But this definitely is a minor observation, it doesn't bother me at all. And the performance is all right with me now, the whole page took 2,4 seconds to load on first try. Looks like your server changes paid off! (And caching options with ProcessWire are sweet.)
  5. Hi, wow, this is weird: I am running two sites with one ProcessWire installation. Both are using VersionControl module. I moved both sites to another webserver right after installing VersionControl. On site #1 ...sometimes (!) file upload is not possible (the pink status bar gets stuck at 100 %) already uploaded files (before moving to the new server) cannot be deleted file descriptions cannot be changed no error messages are given, not even in debug mode While on site #2 ...everything's fine: uploading, deleting, changing the description... I read Douglas' post on a glitch in dev 2.5.19, but I'm using the regular 2.5(.0). nghi's post on a similar problem describes pretty much what I'm experiencing here, but if there was something wrong in the suhosin.ini, site #2 would encounter the very same problem. If I use VersionControl to set the file field back to an earlier version where the file was not uploaded yet, the file disappears and is deleted from /assets/file/[page-id]/. Same vice-versa when setting to a version before a file was deleted: It is recreated on the page and in the filesystem. Permissions are -rw-rw-rw- for all files. Any ideas? Sarah
  6. This needs to be moved to the "modules" forum: It definitely is a shoppingCart problem. The complete database query is: INSERT INTO ShoppingCart SET items = '[{"product_id":3124,"qty":1}]', total_sum = 10,50, session_id = 'e3bc4bb75fa765aefc4695fa27820f1464f39fb3' ON DUPLICATE KEY UPDATE items = '[{"product_id":3124,"qty":1}]', total_sum = 10,50 From my point of view the problem seems to be the comma separated price used for the query. While the sc_price field contains "10.50" (with a dot as decimal mark), for unknown reasons a comma is used as a result for this query line ShoppingCart.module: // Update cart to db or insert new row if there isn't $update = $this->db->query("INSERT INTO {$this->className} SET items = '$items', total_sum = $total_sum, session_id = '" . $this->getSession() . "' ON DUPLICATE KEY UPDATE items = '$items', total_sum = $total_sum"); My module settings define a comma as decimal mark: Though this comma should not be used unless it is produced via $this->renderPrice($total_sum). No explanation/solution so far.
  7. Hi, hopefully you can give me some advice on debugging an error with a ProcessWire 2.5 site using ShoppingCart module (and Version Control module): When guest users try to add a specific product to the shopping cart, a "500 Internal Server Error" page is thrown and the following error is logged in assets/logs/errors.txt: 2015-05-25 18:28:06 guest http://127.0.0.1/pw/product-12 Error: Exception: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '01, session_id = 'd41a2726a1f1d8205f45ce240da65af10517c74f' ON DUPLICATE KEY UPD' at line 1 (in /var/www/pw/wire/core/Database.php line 114) Since only a part of the SQL error is shown, I have difficulties to find out what's wrong here. The error does only occur with two products (a hundred others are fine) and only with guest users. If I add these products as a logged in admin, everything works great. The database tables do not include a session ID d41a2726a1f1d8205f45ce240da65af10517c74f. How do I get a more specific error message from ProcessWire? Thanks Sarah
  8. Here's what I did as a workaround: I've got this page /books/the_jungle_book (template: book)and added a quasi duplicate of this page /pdfs/the_jungle_book (template: pdf) – containing only the necessary fields title, author, sc_price, sc_qty, with a 1:1 content copy of the fields in page /books/the_jungle_bookThen for the ShoppingCart "purchase" button, I use (in the template file books.php): // book $content .= $modules->get("ShoppingCart")->renderAddToCart()); // pdf $pdf = $pages->find('template=pdf,title='.$page->title)->first(); $content .= $modules->get("ShoppingCart")->renderAddToCart($pdf)); I know this is not elegant at all, but at least it works for now. Yes, I did write: "Since there will be many different pages with books, manually adding a second page for the printed book is not an option." Since the workaround requires to manually add both a 'book' and a 'pdf' page: How can I create the pdf page automatically once a user creates the book page?
  9. Hi, now I need your help getting an idea: I've got a page "The Jungle Book" containing details on the book by Rudyard Kipling. With ShoppingCart module, I'd like to offer the book both as a PDF for download as well as a printed version. I added the sc_price and sc_qty fields to the page, which is half of what I need: Now the page renders a button to put the book (let's say it's PDF version) into the shopping cart. How do I add a second version of this product on the same page? Titel, price and all the details will be the same, only the actual type of the product (digital version instead of printed version) differs. Since there will be many different pages with books, manually adding a second page for the printed book is not an option. Thanks for your ideas! sarah P.S.: There is this post by apeisa on adding different variations of a product into the shopping cart. But I haven't figured out what's a good way to refer back to the original page (for getting the product information) once a variation is placed in cart.
  10. Great, thanks a lot! Extra question: If I want to add "Name: " as extra text to the new combined field – how could I do this?
  11. Hi, I've got three fields in a template page: name surname full name (hidden field) Now I'd like "full name" to be a combination of "name" and "surname". There's no need to use javascript, since I only need the "full name" field later on for processing. Would be totally fine to populate "full name" once the page is saved. I don't have any experience with hooks, any hints how I could get the merging done? Thanks sarah
  12. Okay, got it: While the PaymentAbstract.php is in /ShoppingCart/, PaymentPaypal.module installs into a new folder /PaymentPaypal/ and cannot be installed when in /ShoppingCart/. So I just edited this line of /site/modules/PaymentPaypal/PaymentPaypal.module require_once(dirname(__FILE__) . '/PaymentAbstract.php'); into this: require_once(dirname(__FILE__) . '/../ShoppingCart/PaymentAbstract.php'); Now it's possible to install the paypal method and use it with ShoppingCheckout.
  13. Alright, now I get it. Though I can't manage to get the module running: I uninstalled everything except for shop-for-pw (ShoppingCart and ShoppingCheckout). When I try to install the old paypal method zip file, the admin page returns this error: Compile Error: require_once(): Failed opening required '/var/www/processwire/site/modules/PaymentPaypal/PaymentAbstract.php' (include_path='.:/usr/share/php:/usr/share/pear') (line 3 of /var/www/processwire/site/modules/PaymentPaypal/PaymentPaypal.module) So again I copied PaymentAbstract.php into /PaymentPaypal/, and again the error message changes to: Compile Error: Cannot redeclare class PaymentAbstract (line 3 of processwire/site/modules/ShoppingCart/PaymentAbstract.php)
  14. Hi apeisa, thanks for your reply! So what will I do to install the deprecated paypal module without getting the error message? Only install shop-for-pw (ShoppingCart and ShoppingCheckout) and the old paypal module? Right now I also have the PaymentModule installed as well. Sarah
  15. Oh well, I just read my last post again. Looks I got really confused with word beginnings and endings, that one doesn't really make sense. But somehow you got exactly what I wanted to say (and didn't manage to)! Excellent, thanks a lot!
  16. Hope I got you right. I put the <script> tags to the end of the page, right in front of the </body> tag. Doesn't change anything.
  17. Hi guys, I am a bit confused with the different PayPal payment modules existing. There's this new PaymentModule and there's the old Paypal payment method for ProcessWire Shop module. I used the ShoppingCart module with my current ProcessWire site and would like to add a PayPal payment method. So I installed the new PaymentModule, PaymentInvoice and PaymentPaypal. On the checkout page, I get this: <label for='paymentmethod'>Payment method: <span class='reqstar'>*</span></label><select name='paymentmethod'><option value='PaymentModule'></option><option value='PaymentInvoice'>Invoice</option><option value='PaymentPaypal'></option></select> So in the dropdown, the first (PaymentModule) and third line (PaymentPaypal) are empty and only the Invoice is written down though all three are selectable. I chose Paypal - nothing happened, the whole output was: "1". Well... I deinstalled the Paypal module and tried to install the old Paypal payment method. On install, the first error message informs me there's no PaymentAbstract.php to include. Copied the file from site/modules/ShoppingCart to site/modules/PaymentPaypal and tried again. Result: "Compile Error: Cannot redeclare class PaymentAbstract (line 3 of /var/www/processwire/site/modules/PaymentPaypal/PaymentAbstract.php)" Any ideas what I did wrong? Is it right that I should use the deprecated PayPal method with the ShoppingCart module? Thanks sarah
  18. Lovely little module! It works perfectly in my 2.5 installation, except for one thing: Links containing "mailto:" seem to get mixed up and are stuck in the obfuscated, reversed order. Example: mail@example.com <a href="mailto:mail@example.com">mail@example.com</a> turns into <span style="unicode-bidi:bidi-override; direction: rtl;" class="email-obfuscator-unreverse">moc.elpmaxe@liam</span><br /> <a href="GOSPAM:moc.elpmaxe@liam"><span style="unicode-bidi:bidi-override; direction: rtl;" class="email-obfuscator-unreverse">moc.elpmaxe@liam</span></a> (the output on the page is mail@example.com for both lines, but the link is broken and still reversed: gospam:moc.elpmaxe@liam) Any ideas what went wrong? The JavaScript file is included before the </head> tag.
  19. Hi, thanks for giving the example you used, Cerulean! I realised an unwanted behaviour and don't know how to solve this: If you search for "test", also "latest" or "contest" will be among the results. So I'd like to make sure the search term ("test") is prepended or followed by a space: $selector .= "title%=' $term', "; $selector .= "title%='$term ', "; However, this does not have any effect on the SQL query and the results. (Same if you put "title%= $term, " without the ' ' quotation marks.) Any ideas?
  20. Hi, still amazed by the possibilities of Inputfield Dependencies, but haven't quite figured out how to use it: There's pages in different paths: HomeNobel prizeLiterature2012Page 1 Page 2 ... Economics2012 2011Page 1 Page 2 ... Yeah, I know, this structure doesn't make much sense at first sight. But trust me, it's elaborated. ;-) Now I've used one single template for Page 1, Page 2, etc. and it needs to be all the same. Only the field "topic" is different: I need it to be shown for pages in /nobel-prize/literature/..., but hidden for all other pages (like the ones in /nobel-prize/economics/...). So I put path%='literature' as a "Show this field only if"-condition. Doesn't work. What did I misunderstand? Thanks a lot Sarah
  21. Thanks, you're absolutely right. I thought I tried this in first place, I've seen too much code yesterday, I suppose.
  22. Hi, well, here's something I just don't understand and didn't find an explanation in the reference for. I've got a number of pages: HomeAuthorTomas Tranströmer José Saramago Kenzaburō Ōe ... Nobel prize2012 2011 ... I created a field "author", type Page, which contains all these 3rd level pages (Tomas Tranströmer, José Saramago, Kenzaburō Ōe, ...). In the template used i.e. for /nobel-prize/2011, the "author" field is populated and contains the page ("Tomas Tranströmer"). Now I would like to create an output: $content .= $pages->get($page->author)->title; Confusingly, the output is Home although the output for $content .= $page->author; is 1026 and the output for $content .= $pages->get(1026)->title; is the desired Tomas Tranströmer So I seem to create a problem with using $pages and $page in the same line, but what is it exactly and how will I fix it? Thanks a lot!
  23. Hi, recently I asked a question regarding the PageNameURL generator. Is it also possible to use the generator within a template to create urls out of field content? I have an array representing a list of names, some of them containing various special characters, i.e.: Tomas Tranströmer José Saramago Kenzaburō Ōe Gabriel García Márquez Halldór Laxness François Mauriac Władysław Reymont Now I'd like to create urls like: /author/wladyslaw-reymont or /author/kenzaburo-oe Is there a PageNameURL generator function I can use to convert the special characters? Thanks a lot! Sarah
  24. Great, thank you for the explanation! I completely forgot looking up the parameters for the function.
×
×
  • Create New...