Jump to content

Davabo

Members
  • Posts

    4
  • Joined

  • Last visited

Everything posted by Davabo

  1. Thank you both for your replies, worked perfectly <3
  2. Hey guys, I'm currently building a shop page for a friend and im creating all the options via the panel. So when he wants to add a new item to his shop, he goes to the specific page and adds all the information in via the panel. I have everything working perfectly, mostly using checkbox field types for available sizes etc.... He has asked me now to give each product a colour item, but the catch is that he wants to be able to type in the colour himself. As you know many products come in different colours so i cant create a selection from him to choose from a list of colours like i have done with sizes. So I built a repeater field with a textarea inside. My question is how do i output these inputs on the page in a select box? Here is my code so far, The problem with the code above is that it creates a seperate selectbox for each colour input. I have tried a few different things like eq(1n), first() etc... and nothing works. I would really appreciate some help. Thank you!
  3. Thank you for your super helpful response. Ive followed your instructions and i adapted the code to suit my own setup. I should have mentioned each item page has 2 images in it. When i run the code below, the page titles show up but the images only form some sort of array. Heres my code, and heres the output my code: <?php foreach($page->Children() as $category) { // optionally $page->children("template=your_category_template") echo "<p class='category'><a href='$category->url'>$category->title</a></p>\n"; echo "<div class='article_gallery'>\n"; foreach($category->Children() as $article) { echo "<a class='gallery' title='$article->title' href='$article->url'> <img src= '$article->product_image->first()->url'> </a>\n"; } echo "</div>\n"; } ?> And when the images do not load, and i inspect the elements, its showing the images linking like this <img src= 'text.png|text-1.png->first()->url'> So it looks like the images have to be split from the array somehow? Ive tried different variations of the line "$article->product_image->first()->url' with no luck. Thanks for your help
  4. Hey guys, Currently im building a shopping cart for my processwire site. The layout right now is like this Home About FAQ Shop Socks Sock 1 Sock 2 Sock 3 Shoes Shoe 1 Shoe 2 Shoe 3 Jackets Jacket 1 Jacket 2 Jacket 3 Basically each sub-item page like "sock 1","shoe 1" has its own page with the title/image/price etc... And what im trying to do now on the "Shop" page is display all the grand-children page images like "sock1/sock2/sock3/shoe1/shoe2/shoe3" etc.. in a gallery so when the user clicks one of the images it brings them straight to the item page. Then the "filter" pages like "socks", "shoes", "jackets" are going to be sub-headings within the shop page that when clicked will show all the items under that filter. So if someones on the main shop page, and clicks the sub heading socks, then I want only the sock items to show up in the gallery. The same for shoes and jackets also. Ive been messing around with all the grand children code i can find on the forum and the site and i can't get anything even slightly working . I am very new with php so this is quite a struggle, i really hope you guys understood me and have any solutions. Thank you
×
×
  • Create New...