mattcohen

Members
  • Content Count

    39
  • Joined

  • Last visited

Community Reputation

4 Neutral

About mattcohen

  • Rank
    Jr. Member

Contact Methods

  • Website URL
    https://www.vapeprices.co.nz/

Profile Information

  • Gender
    Male
  • Location
    New Zealand

Recent Profile Visitors

1,421 profile views
  1. mattcohen

    Thanks heaps for your suggestions, Robin. I am looking to improve the structure over the weekend & will take these on board Thanks tpr, Will look into this!
  2. mattcohen

    Thanks, Gideon, What I was hoping to do was to perform the same search but limit it at the lowest and highest ends of the spectrum (e.g. Highest price and lowest price). Does that make sense?
  3. mattcohen

    Hi Gideon, the price field that it's been sorted by is the price field name.
  4. Hi Team, I am having trouble sorting prices in my foreach loop and am wondering is becasuse my price field is a text field and not a number field. My code is <?php $item_title = $item->title; $items = $pages->find ("template=Listing, limit=15, sort=title"); foreach ($items as $item?> <tr> <td>{item.brand}</td> <td>{item.model}</td> <td> <?php $item_title = $item->title; $store_price = $pages->find ("template=PriceSpy, sort=price, title=$item_title, limit=1") ; foreach ($store_price as $price) :?> {price.price} <?php endforeach ;?> </td> <td> <?php $item_title = $item->title; $store_price = $pages->find ("template=PriceSpy, sort=-price, title=$item_title, limit=1") ; foreach ($store_price as $price) :?> {price.price} <?php endforeach ;?> </td> </tr> <?php endforeach ;?> The offending page is this one: https://www.vapeprices.co.nz/price-guide/. Whereas you can see the Low and High columns are just not making sense I would really appreciate any help.
  5. Thanks @horst and @thetuningspoon
  6. Hi All, I am wondering if anyone has come up with an easier way of merging their local environment with the live production environment. For instance, my thinking would be to use Site Profile Exporter, install Processwire in the main directory of the live environment & install. Just to clarify, This is if I am doing a lot of structural changes obviously to both the template fields level and the templates themselves. Otherwise, it would be just the normal (keeping two copies in sync and uploading etc). Does anyone have any solutions?
  7. Thanks for your help horst. This worked amazingly.
  8. Hi All, I am experiencing issues in including files that are in multiple sub directories. They don't seem to load or break the File Compiler Tags module. My syntax is as follows <?php require 'src/components/breadcrumbs.php'; require 'src/components/topmeta.php'; require 'src/components/page.php'; ?> Anyone else have issues relating to this? I'm using the latest PW build.
  9. Hi All, I am wondering if anyone has a solution to my problem. I have a website that I have at a DomainA.com, but I am wanting all templates/static assets (such as images uploaded by the user, PW, etc) to be assets.domaina.com Is this possible? From what I've read in the forums - you need to use some special htaccess code, but the posts are from a few years ago.
  10. Hi guys, I am wondering how I deal with this error message. Whenever I am trying to save a page I am getting this error when someone enters the same name in the "name" textbox. Here is my code <?php if ($input->post->reviews || $input->post->name) { // Save in the ProcessWire page tree; map submission to the template fields $np = new Page(); // create new page object $np->template = $templates->get("reviews"); $np->parent = $pages->get("/reviews/"); $name = $sanitizer->text($input->post->name); $email = $sanitizer->text ($input->post->email); $review = $sanitizer->text ($input->post->review); // Match up the sanitized inputs we just got with the template fields $np->of(false); $np->title = $name; $np->page_id = $page->id; $np->name = $name; $np->email = $email; $np->review = $review; $np->save(); } ?>
  11. mattcohen

    Thanks for all of your help. I managed to get the desired end result using Ryan's example:
  12. mattcohen

    Just curious, if I had a select input by the name of "type" - Can I call that directly and output the options
  13. mattcohen

  14. mattcohen

    Thanks for your reply, can you give me an example of how I might implement this?
  15. mattcohen

    Hi, I am wondering if there is a better way to output a field's options Currently I am basically adding types as they are required, but I can see the types growing - and wondering if I can call directly from the field? <select name="product_type" class="form-control" style="font-size:9pt"> <option value=""><?php echo $NO_SELECT_PRODUCT; ?></option> <option <?php if ($pt == "Starter Kits"){echo 'selected';};?> value="Starter Kits">Starter Kits</option> <option <?php if ($pt == "Advanced Kits"){echo 'selected';};?> value="Advanced Kits">Advanced Kits</option> </select>