Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • [email protected]

    (@myburghbernardgmailcom)

    I have a solution.

    Use the shortcode: [add_to_cart id="971"], with 971 being the id of the variation product, or rather, the unique id of a variation of a variable product.

    Then for some reason I have to edit the actual woocommerce file “class-wc-shortcodes.php” becasue I can’t seem to get my theme file to override it.

    1. Open class-wc-shortcodes.php
    2. Look for the function with comment Display a single product price + cart button., should be line 419.
    3. Then look for line: <?php if ( 'true' == $atts['show_price'] ) : ?>
    4. Inside there should be <?php echo $product->get_price_html(); ?>
    5. Now just add new things like:
    • <?php echo $product->get_title(); ?>
    • <?php echo $product->get_categories(); ?>
    • <?php echo $product->get_sku(); ?>
    • <?php echo $product->get_image(); ?>

    Of course, you can get more detailed and put divs and things to style the output to look just like you are outputting a normal product using the shortcode [product sku="ZN1U0000RS"] for example.

    This would be such sensationally easy functionality for woocommerce to add, i.e. when you put in the shortcode [product sku="ZN1U0000RS"] for example, it outputs the same regardless of whether it is a simple or variation of a variable product. Sometimes I want my client to add the variation I suggest, instead of having them go to the variable product page to select a variation. An sku is an sku. An id is an id. A variation of a product should be treated just like any other product. It deserved the same respect.

    [email protected]

    (@myburghbernardgmailcom)

    i know your pain. here is the solution.

    stop xampp completely, restart computer if you have to.
    open terminal and type in.. actually just read this blog post i did on that error on phpmyadmin
    https://bernardmyburgh.wordpress.com/2012/10/31/a-better-solution-to-error-13-in-xampp-because-no-one-is-explaining-it-right/

    then open xampp, CHECK to see if phpmyadmin is working, if it is, basically, then your wp-admin area will be able to store / access categories you create and make, etc.

    SO, for future workflow reasons, FIRST just out of habit, go into terminla and do the sudo chmod 600 thing explained in my post above, THEN ONLY check if php my admin is working, THEN FINALLY, breathe easy and launch into wordpress.

    hope that helps.

Viewing 2 replies - 1 through 2 (of 2 total)