Jump to content

Claus

Members
  • Posts

    82
  • Joined

  • Last visited

Everything posted by Claus

  1. Hi Martin I’m afraid it doesn’t quite get me there, I just get Notice: Undefined variable: p in /yada/yada/… Is this `p` variable supposed to be a part of Padloper? That not withstanding, I need to have my repeater fields because they *are* the products. And when I do that I get this error: Notice: Object of class RepeaterPage could not be converted to int in /www/site.site/site/modules/PadCart/PadCart.module on line 82 So I’m doing wrong or have an unexpected format in the `sc_item`. I’d love to not have to start again from scratch (there are hundreds of products), but if all else fails…
  2. Okay, so maybe someone can help a noob like me. I’m sitting here with the pages from the old shop system, and I want to convert them to PadLoper. I have this in my old add-to-cart page: //sc_item is my repeater field foreach ($page->sc_item as $product) { $contentThree .= "<span class='sc_item'>" . $product->sc_name . "</span></br>"; $contentThree .= "<span class='sc_price'>" . $modules->get( "ShoppingCart" )->renderPrice( $product->sc_price ) ."</span> excl. VAT"; $contentThree .= "<span class='sc_add'>" . $modules->get("ShoppingCart")->renderAddToCart($product). "</span>"; } What do I change – or said in another way – what are the PadLoper names equivalent to ShoppingCart, renderPrice, and renderAddToCart? (If this is in the documentation I can’t find it!)
  3. The version I have is the one from 24th of May - is that the latest one? The cart-add-product.php template is null - is there non-null version? ;-)
  4. Aha! Solved it, so I'm going to answer my own question in case someone else runs into this. The PHP must be compiled with the option ZIP to *really* have it "built-in". In the case of this OpenSUSE build, it is not, and must instead be installed using PECL. Initially the PECL install didn't seem to work, eg. `sudo pecl install zip`, until I realized that it needed the path too `sudo pecl install pecl/zip`, but then it worked.
  5. Hello people When trying to install a module via a ZIP-file I am getting the following error: Session: ZipArchive class is required and your PHP does not appear to have it. I don't understand why this happens! I have the latest and greatest PHP 5.6.9 and path to the extensions is correct, and the Zip-extension should be built-in (since 5.3.0 I think). I'm only encountering this on a OpenSUSE Tumbleweed box, where I have php5-devel installed. My check_php.php file show that the Zip and Zlib listed under 'Modules'. What to do?
  6. It’s a sad state of affairs. I’ll see what my local rules are.
  7. Oh dear gawd. So I have to tally the sum of deferred VAT and then reverse charge that… ? Jesus what a complicated system.
  8. It is an EU thing now. The shop needs to support the lookup of the buyer’s VAT-number, and if found valid delete the VAT from the bill.
  9. In the ways I tell him to No, I mentioned what I need in this post:
  10. For my part I can say that I have hired a developer to extend the existing ShoppingCart. Haven’t started yet, but it feels a bit silly to develop something that would quite possibly be included in the new shopping cart system. The developer I’ve taken on is very capable, so if you want to have his eyes on your new system let me know .
  11. I would be very interested in this module. Currently fiddling with the existing ShoppingCart, but there is a lot of features I need to build on top of it (invoice generation, license agreement generation, taxes, VAT lookup, emailing and so on).
  12. Hello there I would like to use one of the custom fields in the ShoppingCart as a company name, and then have it moved up to the top of the listing on the checkout page. I can get the field activated but I can’t figure out how to move it to the top of the list. Can someone tell me where (and possibly even how) to perform the surgery?
  13. Okay, so I figured it out. I have individual products as repeater fields on a given product page, and each of these items have a full name. So I went to line 219 of ShoppingCart.module and replaced the section with this: $title = $product->sc_name; … and I now get the correct title of each item.
  14. Okay, one bonus question: I can’t figure out how to get the names of the repeater items to appear after I have added them to the shopping cart. Instead I get the title of the page, which I am guessing ShoppingCart presumes is the product proper, for each of the added items. How can get the name of each added item instead? I’ve tried to see what I could find in the module, but only got as far as this: https://github.com/apeisa/Shop-for-ProcessWire/blob/master/ShoppingCart.module#L219 and as I read it, the module should automatically construct the names from the page/product name plus the repeater-name (l. 222).
  15. Hi there! I’m using Apeisa’s ShoppingCart module to do a little shop. I have pages each with a range of products as repeater items. These items have different prices (package deals, individual products and so on). They all render with correct names and prices. So far so good! Now the issue: When I add one or more products to the cart I get the $title of the $page instead of the product name, and the price is set to the price of the first product on the page no matter which product I add to the cart. So I’m doing something wrong. Here is the code I’m using: // Primary content is the repeater fields of "sc_item" $contentThree = ''; //sc_item is my repeater field foreach ($page->sc_item as $product) { $contentThree .= "<span class='sc_item'>" . $product->sc_name . "</span></br>"; $contentThree .= "<span class='sc_price'>" . $modules->get( "ShoppingCart" )->renderPrice( $product->sc_price ) ."</span> excl. BTW (VAT)"; $contentThree .= "<span class='sc_add'>" . $modules->get("ShoppingCart")->renderAddToCart(). "</span>"; } $contentThree .= $modules->get("ShoppingCart")->renderCart(); Can anyone point me in the right direction?
  16. Bingo! Being the n00b that I am I had not considered that possibility Thanks fokke!
  17. That was also what I was thinking, but PW gives me the same error: Undefined variable: template … if I put it in _main.php. I’m quite puzzled by this one.
  18. I’m trying to use the $template->name by declaring this in "_init.php": $cssFile = $template->name . ".css"; … and I then have this in "_main.php": // Use custom CSS-file if that file exists. <?php if(is_file($config->paths->templates . "styles/$cssFile")) { echo "<link rel='stylesheet' type='text/css' href='{$config->urls->templates}styles/$cssFile' />"; }; ?> However PW throws this notice: Notice: Undefined variable: template in /Users/claus/Sites/ProcessWire/site/templates/_init.php on line 29 Notice: Trying to get property of non-object in /Users/claus/Sites/ProcessWire/site/templates/_init.php on line 29 // Use custom CSS-file if that file exists. Do I have to define $template->name? I thought that was a built-in function?
  19. Hmm, that didn’t change anything as far as I can tell.
  20. Hello there! I have a question regarding the "renderNav" function used in the ‘intermediate’ site-profile. I have a multi-level menu system going by using the renderNav function, and I’d like to extend the default "renderNav" function to also mark all the parents of any given page with "current". I think I have to modify this line from the "renderNav" function: $out .= $item->id == wire('page')->id ? "<li class='current'>" : "<li>"; … specifically adding something along the lines of foreach parent of the itemid "<li class='current'>" else "<li>", but is there a neat way of putting that into the existing line? Or how would you do it? Thanks!
  21. Okay, so a bit more fiddling brought me to this solution which feels somewhat ‘hacky’ to me, so do feel free to suggest improvements. I made special templates for those category-pages that were just placeholders for deeper content and contained no content of their own, eg. ‘Products’ and ‘News’ in the top level, ‘Apple’, ‘Banana’, and ‘Orange’ in the secondary level. For the category-pages that needed three levels to get to an actual content page I made a template with: <?php $session->redirect($page->child->child->url); … and then assigned ‘Products’ and ‘News’ to this template. And for the the category-pages that needed two levels to get to an actual content page I made a template with: <?php $session->redirect($page->child->url); … and then assigned ‘Apple’, ‘Banana’, and ‘Orange’ to this template. This works! Albeit with the annoyance of these redirects loading a page for each ‘step’ down to the final content-page. This is why I call it ‘hacky’.
×
×
  • Create New...