1
votes

I have a Drupal Panopoly site and I want to add some commerce functionality so I've installed Drupal commerce on my test site. Panopoly, as you may know, is heavily panels based. I've cloned the Shopping cart block as a views pane so I can use it in a panel page and that works perfectly.

On this pane there's a View cart link which takes you to the page mysite.com/cart. That cart link seems to be fixed, I cannot change it to, say, mycart.

My question is how is this cart page defined? I cannot find any page called cart in my site try as I might. There is a view called Shopping cart form but (and this shows my lack of knowledge of views), it looks slightly odd not seeming to have a type (block, page, etc). I have tweaked this and, although it doesn't have a page name so, it is what produces the output of the cart page.

I thought that I would clone this form as a views panel to use in a panel page mycart but this produces an empty cart.

I've googled and read the commerce information but I can't find anything that explains how this works and what I should be doing to change it.

Can someone please explain how I can use the cart in a panel.

2

2 Answers

1
votes

I finally came across this: https://drupalcommerce.org/user-guide/modifying-shopping-cart-using-views.

I took my cloned version of the Shopping cart form view which is a View Panes, and simply changed the contextual filter in accordance with the above instructions.

To keep the answer self-contained:

Change the contextual filter to Provide default value and select Current user's cart order ID.

I now have a pane I can use in a panel. Seemples!

0
votes

Cart page is created from the code, and main part of it is a view.

You can easily change view templates - you edit view called "commerce_cart_form", open "Advanced" panel (group, what ever it is) and click on "Theme: Information"... There you can see what template files are used...and you can edit them.

You can also change the view it self...add new fields or something..