Forum

Thread tagged as: Question

What's the best way to move items to another region?

A potential new project I'm looking at taking on, the client sells cars, not via the website, they just want to list the cars available for sale - this I'm ok with, but they want to have a previously sold page, so any cars sold from the stock page, get moved to the previously sold page.

Is this possible?

I'm thinking, i'd the stock region shared, both the stock page and the previously sold pages have that region, but then have a checkbox to say the car has been sold, those that have been sold, dont get shown on the stock page, and sold cars get shown in the prev sold page.

Does that make sense? Is that the best way of doing it? Should I look into the shop app?

Thanks in advance.

Juan Fernandes

Juan Fernandes 0 points

  • 4 years ago
Duncan Revell

Duncan Revell 78 points
Registered Developer

If you could use Perch Runway, a collection would easily solve the problem (using the checkbox).

It might not be a good idea to use a shared region - the content will be called/queried behind the scenes in EVERY page (I believe).

If standard Perch, set the region up in one page and use perch_content_custom on the other page to call the content from the first page (there is an option to let you specify which page to get the content from).

Drew McLellan

Drew McLellan 2638 points
Perch Support

It might not be a good idea to use a shared region - the content will be called/queried behind the scenes in EVERY page (I believe).

This is correct, and is good advice. Don't use a shared region.

Thanks for the reply.

Unfortunately Runway is not an option for this project.

So using perch_content_custom, will I be able to check / tell it to show / not show items that have been set to sold?

Juan

Drew McLellan

Drew McLellan 2638 points
Perch Support

Yes, but I wouldn't bank on having more than a couple of dozen items in a shared region.

Duncan Revell

Duncan Revell 78 points
Registered Developer

So using perch_content_custom, will I be able to check / tell it to show / not show items that have been set to sold?

Yes, in your region, you would need to add a checkbox allowing the client to tick the box if the car is sold (for example).

Stock page (e.g. stock.php) - we are checking for any cars with an unticked checkbox:

perch_content_custom('Cars', array(
    'filter'=>'id_of_checkbox',
    'match'=>'neq',
    'value'=>1
));

Sold page (e.g. sold.php) - checking for cars with a ticked checkbox, from the stock page:

perch_content_custom('Cars', array(
    'page'=>'/stock.php',
    'filter'=>'id_of_checkbox',
    'match'=>'eq',
    'value'=>1
));

Use the perch_content_custom documentation for reference.