AbanteCart Development > Customization help

Custom layout; different layouts for GS1 & GS2

(1/3) > >>

Geoffrey:
Guest Checkout Step 1 page shares the same layout with Guest Checkout Step 2 page. 

Custom Layouts are simple to create for Product, Category, Manufacturer, or Content pages, but not for a Checkout page. 

I would like to create a custom layout so that Guest Step 1 page can have its own layout different than guest step 2 page.

In the layout.xml file for my template extension, I added a new layout (copied the Checkout Pages section, pasted it, then gave it a new <name> and also [![CDATA... name. 

I hoped that this would show a new layout in the Layouts drop-down menu, but it didn't work. 

What else do I have to do to get a new Custom layout to show up in the Layouts menu, when the new layout is for a checkout page?

Then...

Which file do I edit to assign a new custom layout to guest step 1 page?

Thanks. 

maxter:
All checkout pages share the same layout.
You can see this in the database table ac_layouts.

https://github.com/abantecart/abantecart-src/blob/master/public_html/install/abantecart_database.sql#L10376

If you need to create a completely new layout that is assigned to specific page you need to update following tables.

1. Create new row to ac_layouts:

--- Code: ---INSERT INTO `ac_layouts` (`layout_id`, `template_id`, `layout_type`, `layout_name`, `date_added`)
VALUES
('', 'default', 1, 'Guest Checkout Pages', now());

--- End code ---

2. Register new page in ac_pages:

--- Code: ---INSERT INTO `ac_pages` (`page_id`, `parent_page_id`, `controller`, `key_param`, `key_value`, `date_added`)
VALUES
('', 0, 'checkout/guest_step_1', '', '', now() ),

--- End code ---
Note: You might need to do the same for checkout/guest_step_2, checkout/guest_step_3 ..

3. Create new row to pages_layouts:

--- Code: ---INSERT INTO `ac_pages_layouts` (`layout_id`, `page_id`)
VALUES
([new layout_id from ac_layouts], [new page_id from ac_pages]);

--- End code ---
You repeat this for every new layout / page that you create

Do not forget to clear the cache after you update tables directly.

Load your XML with layout.

Geoffrey:
Hi Maxter. 

Wow, thanks for your clear explanation!  Much appreciated. 

Geoffrey:
OK, I had partial success, but it doesn't work. 

My db prefix is "bob".  My template extension is "joe".

In bob_layouts, I inserted 2 new layouts:
9, default, GS1 Layout, 1
29, joe, GS1 Layout, 1

In bob_pages, I inserted 1 new page:
6,0, checkout/guest_step_1

In bob_pages_layouts, I inserted 2 new relationships:
9, 6
29, 6

So basically I made a new layout and new page-layout association for both the default and joe extensions. 

Then, in root/extensions/joe/layout.xml, I copied the entire set of definitions for the Checkout Pages layout ( from <layout> thru </layout> ), and I pasted it just below the Checkout Pages section, then edited 3 lines on the paste as follows, then saved the file:
<name>GS1 Layout</name>
<controller>pages/checkout/guest_step_1</controller>
<name><![CDATA[GS1 Layout]]></name>

Then I cleared cache for the Configuration and Layouts & Blocks elements. 

The new layout "GS1 Layout" now appears in the Layouts dropdown menu of my template extension, but I have 2 problems:
The new layout only has 1 feature: Content Area.
My guest_step_1 webpage is still using the Checkout Pages layout. 

I think the next steps will probably be to create new pages and specific layout associations for all of my other checkout pages,
and then perhaps to remove the original generalized Checkout Pages rows from the 3 different tables,
but before I do that, I would like to be able to see the full set of fields in my new GS1 Layout, not just the Content Area field.

What else do i need to do so that the new GS1 Layout has a full set of block fields?

Is there another layout.xml file somewhere?  I searched but cannot find one. 

Once I get a complete set of block fields in my new layout, do i need to do something else to assign specific layouts to specific checkout pages?

Thanks. 

Geoffrey:
Hello-o.

Can anyone offer an explanation as to why my new GS1 Layout was empty? 

Can anyone say how to assign a new custom layout to a new custom page and actually have it work? 

Maxman. The Maxster.  Maxorama!  Maximum Maxage!!

what up?

Navigation

[0] Message Index

[#] Next page

Go to full version
Powered by SMFPacks Social Login Mod