WordPress website development
- or -
Post a project like this1611
£25(approx. $31)
- Posted:
- Proposals: 3
- Remote
- #2607598
- Awarded
Description
Experience Level: Entry
i need a little bit of code adjusted
1.
Where ever it has hidden the price from i want it to say "Login to see price" and then redirect them to the https://www.hijabgem.com/my-account/
I had another code that use to do that, but it gave a few other errors, so i replaced it with another. i have that for reference
/*Hide Price*/
add_action( 'init', 'hide_price_add_cart_not_logged_in' );
function hide_price_add_cart_not_logged_in() {
if ( !is_user_logged_in() ) {
// Remove Add to cart from shop page
remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10 );
// Remove Price from shop page
remove_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_price', 10 );
// Remove Add to cart from single product page
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 30 );
// Remove price from single product page
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_price', 10 );
//Remove short description (excerpt) from single product page
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_excerpt', 20 );
}
}
add_filter( 'woocommerce_product_tabs', 'remove_product_description_tab', 98 );
function remove_product_description_tab( $tabs ) {
if ( !is_user_logged_in() ) {
unset( $tabs['description'] );
}
return $tabs;
}
At the moment this code is displaying after the add to cart form, but i want it to display after the description box
/*display Variation in grid*/
/*display Variation in grid*/
add_action( 'woocommerce_after_add_to_cart_form', 'add_content_after_addtocart_button_func' );
function add_content_after_addtocart_button_func() {
echo '.variationtable {margin-top: 20px;} .variationtable tr td {vertical-align: top;font-size: 11px;text-align: center;padding-left: 10px;padding-right: 10px;}.variationtable img { width: 80px; height: 80px; object-fit: cover; } .variationtable tr td:first-child {padding: 0px;}get_available_variations();
/*echo "";
print_r($variations );
echo "
Image
Variation
SKU
Stock Status
<img src="
<?php
}else{
//echo "Product Is not Variable";
//echo "is_type;
}
}
1.
Where ever it has hidden the price from i want it to say "Login to see price" and then redirect them to the https://www.hijabgem.com/my-account/
I had another code that use to do that, but it gave a few other errors, so i replaced it with another. i have that for reference
/*Hide Price*/
add_action( 'init', 'hide_price_add_cart_not_logged_in' );
function hide_price_add_cart_not_logged_in() {
if ( !is_user_logged_in() ) {
// Remove Add to cart from shop page
remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10 );
// Remove Price from shop page
remove_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_price', 10 );
// Remove Add to cart from single product page
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 30 );
// Remove price from single product page
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_price', 10 );
//Remove short description (excerpt) from single product page
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_excerpt', 20 );
}
}
add_filter( 'woocommerce_product_tabs', 'remove_product_description_tab', 98 );
function remove_product_description_tab( $tabs ) {
if ( !is_user_logged_in() ) {
unset( $tabs['description'] );
}
return $tabs;
}
At the moment this code is displaying after the add to cart form, but i want it to display after the description box
/*display Variation in grid*/
/*display Variation in grid*/
add_action( 'woocommerce_after_add_to_cart_form', 'add_content_after_addtocart_button_func' );
function add_content_after_addtocart_button_func() {
echo '.variationtable {margin-top: 20px;} .variationtable tr td {vertical-align: top;font-size: 11px;text-align: center;padding-left: 10px;padding-right: 10px;}.variationtable img { width: 80px; height: 80px; object-fit: cover; } .variationtable tr td:first-child {padding: 0px;}get_available_variations();
/*echo "";
print_r($variations );
echo "
Image
Variation
SKU
Stock Status
<img src="
<?php
}else{
//echo "Product Is not Variable";
//echo "is_type;
}
}
Umair I.
100% (60)Projects Completed
55
Freelancers worked with
50
Projects awarded
27%
Last project
2 Apr 2024
United Kingdom
New Proposal
Login to your account and send a proposal now to get this project.
Log inClarification Board Ask a Question
-
There are no clarification messages.
We collect cookies to enable the proper functioning and security of our website, and to enhance your experience. By clicking on 'Accept All Cookies', you consent to the use of these cookies. You can change your 'Cookies Settings' at any time. For more information, please read ourCookie Policy
Cookie Settings
Accept All Cookies