file locations for style changes to basic MarketPress install

I recently installed MarketPress and am having a surprisingly hard time changing its look to match my site. I am already using an unrelated theme that I like and would like to set up a pretty simple store on pages within that theme. The basics seem to work, but there are some style issues that I’d like to fix and I can’t see exactly where I’d go to make these changes. (I am not a PHP or CSS expert so I would like to start with the existing style(s) and modify.)

So, where do I find the file locations that define the following things I want to change:

1) In the classic, modern, or icons style the “add to cart” buttons change size when moused over (become slightly taller and narrower). The CSS files in marketpress-includes/themes show the exact same CSS for both states so behavior this must be coming from somewhere else?

2a) The default shopping cart at /store/shopping cart has “quantity” as the widest field. I would like to reformat the table so this isn’t the case.

2b) The Quantity field accepts any character and enormous order numbers. If you enter a letter first in the quantity it empties the cart. I assume this is a bug? Where is this field defined so I can add some input validation?

3) The shopping cart widget is too wide for the sidebar on my site. Where is its format defined so I can attempt to reformat and get it to fit properly?

Thanks in advance!

  • Emanaku
    • The Incredible Code Injector

    Hi hart,

    The formatting with CSS allows you to make changes without exactly knowing where the origin of the format is. All you need to know is: Which class or Id or combinations of classes and/or id’s are determining the format of a specific HTML element.

    So for your problems 1, 2a and 3 you need a tool like the add-on firebug for Firefox or you use the Google Chrome browser. With either browser you navigate to your page, right-click (ctrl-click on a Mac) on the element on your page and then choose “inspect with firebug” or just “inspect element”.

    Then you will be shown the CSS styles affecting this element. And you can make temporary changes to find out, which formatting would yield what you want.

    Then you use the styles.css file of your theme (or the respective file of a child theme if you have one) and there you put in the changes of the CSS as you have found out in the previous step. You may need to append an !important to your definitions …

    If you need more specific advise regarding the CSS an URL would be helpful …

    Have fun!!

  • aecnu
    • WP Unicorn

    Greetings Hart,

    Welcome to WPMU Dev!

    2b) The Quantity field accepts any character and enormous order numbers. If you enter a letter first in the quantity it empties the cart. I assume this is a bug? Where is this field defined so I can add some input validation?

    Though there are 142 instances of the word quantity in Market Press, I believe the one you are looking for is in marketpress.php around line 200.

    I would simply ask the lead developer about this and be sure but he is on vacation until the 10th of July.

    Please advise if this is indeed the correct line or not.

    @emanaku some rep points sent your way for your efforts! Nice job.

    Cheers, Joe

  • hart
    • New Recruit

    Emanaku, thank you. That was a very “teach someone to fish” answer! It’s taken longer for me to poke around and figure out what to change, but now I better know how to tackle future issues.

    Joe, thanks for the pointer. Unfortunately, I don’t see what I needed at that line. I think what I need is the place in the PHP code that the main shopping cart is assembled/defined. I still can’t find it (and having a main php file with amost 7000 lines doesn’t make it easy!)

  • aecnu
    • WP Unicorn

    Greetings hart,

    I believe we may be looking in the wrong file, that the answer you seek or rather the place for the solution could be in the /marketpress-includes/template-functions.php file starting at around line 735.

    Please advise if this is even close … lol

    Cheers, Joe

  • hart
    • New Recruit

    I took a look and line 735 is where the actual cart is displayed, but the definition of what is displayed is wrapped in _mp_cart_table. A search revealed that what I was looking for starts on line 175 of template-functions.php as _mp_cart_table is defined. Specifically, the quantity field input definition is on line 214.

    So it wasn’t what I needed but it it was close enough to let me angle in on the finish! :slight_smile: Thanks for the help!

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.