Move WooCommerce Subscription below orders - php

I have a Wordpress website on which I'm using WooCommerce & WooCommerce Subscriptions Add-on.
The problem is that under My Account page, the "My Subscriptions" field appears above the Welcome message. Please check this screenshot: https://dl.dropboxusercontent.com/u/48854464/Screen%20Shot%202014-10-18%20at%202.11.59%20AM.png
I would like the My Subscriptions field to appear below the welcome message.
I have no clue what to modify.. :(
PS: Using Avada Theme.
Could someone please help me? This is the website in question:
http://www.twistedperfectionism.com/my-account/

Open file /wp-content/themes/avada/woocommerce/myaccount/my-account.php, find these 2 lines in this file:
<?php woocommerce_get_template('user-welcome.php'); ?>
<?php do_action( 'woocommerce_before_my_account' ); ?>
Please check whether they are in same sequence. If not, keep it same as above. do_action( 'woocommerce_before_my_account' ); should be below woocommerce_get_template('user-welcome.php');

Related

Remove short product description from WooCommerce shop (archive) pages

For some reason in my shop pages the short description of each product has appeared beneath each product title. I have tried coding this out using:
body.page-id-7 .woocommerce-product-details__short-description {
display: none !important;
However, I have found online that due to it being a WooCommerce page this page ID I have used is not correct.
What is the correct way to remove the product short description from the main shop page?
If anyone knows how to do this please explain in simple terms! I am not the most knowledgeable with code so a step by step would be wonderful.
I still want the product description to be visible on the individual product pages.
Please see my site to see what I am talking about.
If I understand correctly what you want to achieve, you must add this code to your CSS file:
body.archive .woocommerce-product-details__short-description {
display: none;
}
It will looks like this:
screenshot
I added woocommerce/single-product/short-description.php to my theme from the woocommerce plugin then changed the code at the bottom to this:
<?php if ( is_product() ) : ?>
<div class="woocommerce-product-details__short-description">
<?php echo $short_description; // WPCS: XSS ok. ?>
</div>
<?php endif; ?>
I'd prefer to do it with a hook but I wasn't able to find a better solution.
is_product();
Is true if you are on the single product page.
You can get the file from https://github.com/woocommerce/woocommerce/blob/master/templates/single-product/short-description.php

Product description in transactional email Magento

I am using magento 1.9.1 and the e-mail templates. I came with the following code, which should display the product description in transactional e-mails.
<?php echo $this->escapeHtml($_item->getDescription()) ?>
However it does not do that. Does anyone know if somewhere else in the code the description must be loaded first?
Greetings, Marcel
Try Using
<?php $_product = Mage::getModel('catalog/product')->load($_item->getProductId());?>
<?php echo $_product->getDescription();?>

Add link to Shopping Cart on Woocommerce's Checkout page

I've seen many tutorials dealing on how to customize woocommerce's checkout page by adding or removing fields.
But what I want is to place a link or button on the Woocommerce Checkout page saying "Return to Cart" (obviously linking to the cart page) but I want it placed just after the "Your Order" section, (the section where you review your order). I want it there because I want it along with a text saying something like "If you want to change your order return to Cart".
If I edit the actual checkout page and add the link there, it shows all the way to the bottom so maybe I have to add code to the theme's functions file? Any guidance will be greatly appreciated.
Thank you.
EDIT:
Ok, I've found a very crappy way of doing it.
I just added this line to the review-order.php file located in woocommerce/templates/checkout/ , right after the shop_table class:
<?php echo "<strong>If you'd like to change your order, go back to <a href='http://www.mysite.com/cart/'>My Cart</a></strong><br />"; ?>
This does the trick, but everytime I update woocommerce I will have to added it again.
Any suggestion of a more practical and intelligent way of doing it?
Create a child theme.
Put this in the child theme's functions.php
/**
* Add link back to cart after order review on Checkout
*/
add_action( 'woocommerce_review_order_before_payment', 'my_back_to_cart_link' );
function my_back_to_cart_link(){
//get the cart link
global $woocommerce;
$cartUrl = $woocommerce->cart->get_cart_url();
//the HTML markup to add
$backToCartLink="<p class='backtocart'><a class='button alt' href='".$cartUrl."'>".__('Edit Cart','wooint')."</a></p>";
echo $backToCartLink;
}
Well, if you created a child theme you could have put that line in your child's functions.php and then the only way an update would affect it is if they changed the coding.

Magento Track shipment link on order view page not showing

I am unable to get the link to show up on admin end! My client is very irked by it missing. Any ideas?
The file adminhtml/default/default/template/sales/order/view/tab/info.phtml has the following code:
<?php if ($_order->getTracksCollection()->count()) : ?>
<?php echo $this->__('Track Order') ?>
<br/>
<?php endif; ?>
adminhtml/default/your_template_name/template/sales/order/view/tab/info.phtml‌​ also has the same code.
I found out that the program formerly written by another programmer was not uploading the tracking numbers from the warehouse to the correct location in admin. It was adding it to the comments but not to the Shipment section. Once I fixed some code in the program to add the tracking numbers, all issues related were solved. Feel free to contact me if you need some help.

BuddyPress after profile content

In a buddypress site, on the profile page there is this line of code
<?php do_action( 'bp_after_profile_content' ) ?>
Which generates a 'flag this user link'.
What I would like to know is where this file that generates that is as I am, trying to modify it to remove that link from after the profile and place it somewhere else on the profile.
Thanks!
'bp_after_profile_content' is an action, which means there are (probably) a number of other functions hooked into it that actually create the content. Search the BuddyPress source (grep, which I can't work without, or some equivalent) for "add_action( 'bp_after_profile_content' " and you should be able to find those functions. Once you find the function inserting that link you can probably remove it with remove_action() and then hack things to move that link.
<?php do_action( 'bp_after_profile_content' ) ?> code in your profile.php file.
Remove link in your profile page: Simple just remove the code from your profile.php theme file.
Put profile link to somewhere else: Put this code where you display the profile link.
Thanks

Categories