Jump to content

ESRCH

Members
  • Content Count

    80
  • Joined

  • Last visited

  • Days Won

    1

ESRCH last won the day on January 21 2015

ESRCH had the most liked content!

Community Reputation

118 Excellent

About ESRCH

  • Rank
    Full Member

Profile Information

  • Gender
    Male
  • Location
    Geneva, Switzerland

Recent Profile Visitors

2,156 profile views
  1. I made a quick attempt at replicating the issue, but it worked for me. I unfortunately don't have the time to work on this further today, so if someone else has an idea how to solve this...
  2. I'll try to replicate this problem on my side , to see whether I can understand it . However, I have a few questions: - Which version of Processwire are you using ? - What are the fields types of the fields on the product template - When you create an order on the English backend, and then view the order in the back-end in English (by setting your profile language to English), do the order items appear? – Do you have the same problem if you create the order in the chs front-end ? Do the order items then not appear in Chinese simplified, but appear in English and default languages ?
  3. It is a core module, but you have to install it. It's in Modules > Core > FieldType > Profields: Page Table, and you click on Install.
  4. Hmmm, I don't have much time to test myself for the moment, but in your initial code to create the order, try saving the order before adding the order items: Add $p->save(); before foreach($session->get("cart_item") as $cart_item) { Also, I don't see you add a parent to the page during the creation. It might not be necessary, but you can try to see whether this changes anything.
  5. To track how many times a file has been downloaded, the basic process is the following: Have a field to store this information. Increment this counter each time someone downloads a file. Sorry for being so generic, but to be more specific, it would be helpful to have more information: Do you need to track the number of downloads separately for each file? Do you need to track the number of downloads separately for each user? How are files downloaded? It would also help to be more concrete about your use case (what type of site you are building, what type of files your users are downloading on which type of page), so that we can make a concrete example to help you
  6. Since the order items are displayed in two languages, the order items must be created. Can you show the code where you retrieve and then display the order items on the front-end (after clicking on the order in the dashboard)? Since the order item is completely skipped in English (not just displayed without text), it seems like you are using a filter in the loop (something like "if (!$product) continue;"), and there is a problem with this filter in English. If you echo $order->order_items->count(), does it show 0 (nothing) or 1? Also, is there a reason why you use a text field rather than a page field for the product_id on the order_items repeater? Finally, in the code that you pasted above, you wrote $p->save() within the foreach loop. I think you should be able to do that only once under the loop.
  7. It's a very nice website indeed. I just had an issue while viewing the site from my mobile phone (Chrome on Android): there appears to be no background on the navigation, so it is very hard to read depending on the scroll position. I would suggest to add some kind of background color to make the navigation links more visible.
  8. In this case, I would actually suggest to create a new field for the order number, since it complicates things to have a multilanguage field for this value. And as a multilanguage title doesn't make much sense for an order, you could make the title not required and hidden (under the visibility setting) for this specific template.
  9. Indeed, no hook, I hadn't read it through thoroughly enough and had assumed module = hook. And your solution is indeed less complicated, I think I'll replace mine by yours, it makes the code much easier to read
  10. I had the same problem,, and there is actually a way to access the profile language without using a hook by calliing loadPageField function of a Fieldtype, which fetches the data directly in the database: $languageField = $fields->get("language"); $profileLanguageId = $languageField->type->loadPageField($user, $languageField)[0]; $profileLanguage = $pages->get("id=$profileLanguageId");
  11. That's weird indeed. Is there no other message above the notice that you mention? Did you install a module that hooks into ProcessPageEdit or maybe ProcessUser?
  12. You should normally not do this, but I'm assuming that you set System on a page that you created, and that you want to remove this setting. The way to do this with the API is to do as follows: // Assuming that $page refers to the page for which you want to remove the status // Enable overriding the system status flags $page->status = $page->status | Page::statusSystemOverride; $page->save(); // Change the system status flags $page->status = $page->status & ~Page::statusSystemID; // If you want to uncheck the first system checkbox $page->status = $page->statux & ~Page::statusSystem; // If you want to uncheck the second system checkbox $page->save(); // Disable overriding the system status flags $page->status = $page->status & ~Page::statusSystemOverride; $page->save(); If it's just to correct a mistake, the more straightforward way to do the change is by modifying the database directly: In the database, find the right page in the pages table (you can find it easily by name or by id, which is indicated in the url when you edit the page). If you want to remove the first system flag, subtract 8 from the value in the status column (so if it's 9, it should become 1). If you want to remove the second system flag, subtract 16 from the value in the status column (so if it's 17, it should become 1). If you want to remove both, simply combine the operations by subracting 24. I hope this helps!
  13. Glad it solved your problem. Indeed, it's a pretty Swiss thread Though Swiss German would be a little difficult, I'm from Geneva... German would be fine
  14. The problem with the CustomLogout module was that we were using an anonymous function in the hook (the function($event) {...} is an anonymous function), and according to the PHP manual (here, under Changelog), PHP version 5.3 didn't allow using $this within such anonymous functions. So we had to use the "traditional" syntax for hooks, which uses a method of the module. The reason why the SiteHider module is called without needing to install it is probably because it wasn't uninstalled correctly the previously, so it is still in the database (if you look in the modules table in your database, you can probably find the SiteHider module). Before deleting a module from the /site/modules folder, you should always uninstall it first by clicking on its name in the modules list, selecting Uninstall and clicking Save. This will remove the module from the database. I see that I did a typo in my code, there is a > missing: it should be $this->config->styles->add(...); Also, the line above should be if ($this->user->name !== 'selina') because the ! operator has a higher precedence as the === operator. I hope that this solves the problem
  15. Indeed, though after some research, they added support for $this in PHP 5.4, which is why it works on my local server (I have PHP 5.4.7).
×
×
  • Create New...