Digital experiences for all disciplines
Forum Replies Created
-
-
This reply has been marked as private.
Hi Mohammed,
everything seems to go wrong1) I don’t know why you say this? It shows the default shopping page, not my own url. (see screenshot 1)
2) If I past this code in functions .php it does not work and it shows a string on my website. (see screenshot 2)
* I have pasted your previous code of post #151848 in functions.php but as I said when I paste that code my whole website goes blank. (I left it like that for 4 days so you could see but just removed the functions code yesterday because I need to use the website and otherwise it is unusable.
Attachments:
You must be logged in to view attached files.Hi Mohammad,
>That is the old code that I removed because your code gives me a white screen.
I inserted the code you gave now and left it now. As you can see my whole screen is white at the moment.>The screenshot you show is only of the first second, then for some reason it switches to the old cart dropdown. (as you see the button is also not showing in your screenshot, after the first seconds it does)
thanks
This reply has been marked as private.This reply has been marked as private.Solved! Thank you 🙂
This reply has been marked as private.This reply has been marked as private.1) Ah thanks for the screenshot Ed, I see the order detail are supposed to be on the right side of the page. I think in that case with a css fix for the ‘order total’, ‘shipment’ details, to be outlined to the right of the column it should all be ok. Please see the screenshot for clarification
2) No I never noticed it before
Attachments:
You must be logged in to view attached files.Thanks Ed,
1) I uploaded the new version over my current installation. When I place an order now, it still shows the total column completely to the right though :s
2) Something else I noticed is that on the order received page, it now changes all the titles of the footer text to “order received”. The links work correctly though.
Attachments:
You must be logged in to view attached files.This reply has been marked as private.This reply has been marked as private.This reply has been marked as private.Ah ok 🙂
I copied the file functions.php to my child theme and added the whole function there:
/* CART DROPDOWN ================================================== */ if (!function_exists('sf_get_cart')) { function sf_get_cart() { $cart_output = ""; // Check if WooCommerce is active if (sf_woocommerce_activated()) { global $woocommerce; $options = get_option('sf_dante_options'); $show_cart_count = false; if (isset($options['show_cart_count'])) { $show_cart_count = $options['show_cart_count']; } $cart_total = $woocommerce->cart->get_cart_total(); $cart_count = $woocommerce->cart->cart_contents_count; $cart_count_text = sf_product_items_text($cart_count); if ($show_cart_count) { $cart_output .= '<li class="parent shopping-bag-item"><a class="cart-contents" href="'.$woocommerce->cart->get_cart_url().'" title="'.__("View your shopping cart", "swiftframework").'"><i class="ss-cart"></i>'.$cart_total.' ('.$cart_count.')</a>'; } else { $cart_output .= '<li class="parent shopping-bag-item"><a class="cart-contents" href="'.$woocommerce->cart->get_cart_url().'" title="'.__("View your shopping cart", "swiftframework").'"><i class="ss-cart"></i>'.$cart_total.'</a>'; } $cart_output .= '<ul class="sub-menu">'; $cart_output .= '<li>'; $cart_output .= '<div class="shopping-bag">'; if ( $cart_count != "0" ) { $cart_output .= '<div class="bag-header">'.$cart_count_text.' '.__('in the shopping bag', 'swiftframework').'</div>'; $cart_output .= '<div class="bag-contents">'; foreach ($woocommerce->cart->cart_contents as $cart_item_key => $cart_item) { $bag_product = $cart_item['data']; $product_title = $bag_product->get_title(); $product_short_title = (strlen($product_title) > 25) ? substr($product_title, 0, 22) . '...' : $product_title; if ($bag_product->exists() && $cart_item['quantity']>0) { $cart_output .= '<div class="bag-product clearfix">'; $cart_output .= '<figure><a class="bag-product-img" href="'.get_permalink($cart_item['product_id']).'">'.$bag_product->get_image().'</a></figure>'; $cart_output .= '<div class="bag-product-details">'; $cart_output .= '<div class="bag-product-title"><a href="'.get_permalink($cart_item['product_id']).'">' . apply_filters('woocommerce_cart_widget_product_title', $product_short_title, $bag_product) . '</a></div>'; $cart_output .= '<div class="bag-product-price">'.__("Unit Price:", "swiftframework").' '.woocommerce_price($bag_product->get_price()).'</div>'; $cart_output .= '<div class="bag-product-quantity">'.__('Quantity:', 'swiftframework').' '.$cart_item['quantity'].'</div>'; $cart_output .= '</div>'; $cart_output .= apply_filters( 'woocommerce_cart_item_remove_link', sprintf('<a href="%s" class="remove" title="%s">×</a>', esc_url( $woocommerce->cart->get_remove_url( $cart_item_key ) ), __('Remove this item', 'woocommerce') ), $cart_item_key ); $cart_output .= '</div>'; } } $cart_output .= '</div>'; $cart_output .= '<div class="bag-buttons">'; if ( version_compare( WOOCOMMERCE_VERSION, "2.1.0" ) >= 0 ) { $cart_url = apply_filters( 'woocommerce_get_checkout_url', WC()->cart->get_cart_url() ); $checkout_url = apply_filters( 'woocommerce_get_checkout_url', WC()->cart->get_checkout_url() ); $cart_output .= '<a class="sf-button standard sf-icon-reveal bag-button" href="'.esc_url( $cart_url ).'"><i class="ss-view"></i><span class="text">'. __('View shopping bag', 'swiftframework').'</span></a>'; $cart_output .= '<a class="sf-button standard sf-icon-reveal checkout-button" href="'.esc_url( $checkout_url ).'"><i class="ss-creditcard"></i><span class="text">'.__('Proceed to checkout', 'swiftframework').'</span></a>'; } else { $cart_output .= '<a class="sf-button standard sf-icon-reveal bag-button" href="'.esc_url( $woocommerce->cart->get_cart_url() ).'"><i class="ss-view"></i><span class="text">'. __('View shopping bag', 'swiftframework').'</span></a>'; $cart_output .= '<a class="sf-button standard sf-icon-reveal checkout-button" href="'. esc_url( $woocommerce->cart->get_checkout_url() ).'"><i class="ss-creditcard"></i><span class="text">'.__('Proceed to checkout', 'swiftframework').'</span></a>'; } $cart_output .= '</div>'; } else { $cart_output .= '<div class="bag-header">'.__("testing 0 items in the shopping bag", "swiftframework").'</div>'; $cart_output .= '<div class="bag-empty">'.__('testing Unfortunately, your shopping bag is empty.','swiftframework').'</div>'; $shop_page_url = ""; if ( version_compare( WOOCOMMERCE_VERSION, "2.1.0" ) >= 0 ) { $shop_page_url = get_permalink( wc_get_page_id( 'shop' ) ); } else { $shop_page_url = get_permalink( woocommerce_get_page_id( 'shop' ) ); } $cart_output .= '<div class="bag-buttons">'; $cart_output .= '<a class="sf-button standard sf-icon-reveal shop-button" href="http://test.freshfolds.nl/start/"><i class="ss-cart"></i><span class="text">'.__('test Go to the shop', 'swiftframework').'</span></a>'; $cart_output .= '</div>'; } $cart_output .= '</div>'; $cart_output .= '</li>'; $cart_output .= '</ul>'; $cart_output .= '</li>'; } return $cart_output; }
However, after doing that my whole site gets blank. What am i doing wrong?
Thanks Kyle,
I applied the url change in the code but just like the text, also this url change does not appear on my site. It seems as thought the child sf-header.php is not catching on. Is my set up correct? I thought I needed to change sf-header.php in order to make this change work but please correct me if I’m wrong..
-
Posted in: Reply To: adjust go to shop button