Digital experiences for all disciplines
New Landing › How can we help? › Themeforest Theme Support › Neighborhood › [How to] Adding extra description field
New Landing › How can we help? › Themeforest Theme Support › Neighborhood › [How to] Adding extra description field
- This topic has 15 replies, 6 voices, and was last updated 10 years by Melanie – SUPPORT.
-
Posted in: Neighborhood
-
August 27, 2013 at 8:55 pm #18450
Hi Guys,
I see alot of people asking how to add an extra description field on a single product page. I know this is a support forum and for advanced php/html customization a developer is indeed the best option. But maybe we can work together and spare some bucks & help each other out.
I managed to get an extra description field on a single product page by copying the lines in: neighborhood/includes/swift-framework/sf-woocommerce.php (line 253 – 270) and place them on line 271 (so right beneath):
<div class="accordion-group"> <div class="accordion-heading"> <a href="#product-desc"> <?php _e("Description", "swiftframework"); ?> </a> </div> <div id="product-desc" class="accordion-body collapse in"> <div class="accordion-inner"> <?php if ($enable_pb_product_pages) { echo do_shortcode($product_description); } else { the_content(); } ?> </div> </div> </div>
This creates an extra field on the front-end.
For the back-end:
Go to neighborhood/includes/swift-framework/meta-boxes.php and on line 734 – 742 copy:// PRODUCT DESCRIPTION array( 'name' => 'Product Description', 'desc' => "You can optionally write a product description here, which shows under the description accordion heading if you have the page builder enabled for product pages.", 'id' => "{$prefix}product_description", 'type' => 'textarea', 'std' => "", 'cols' => '40', 'rows' => '8', ),
Place this right beneath on line 744 or so..
Now you have 2 description fields, with the same content in it, only thing I didn’t manage to find out was how to get the content in the new description field because when I put in some text in the backend I see the same text…
This is probably because of the lines 261 – 267 in sf-woocommerce.php:
<?php if ($enable_pb_product_pages) { echo do_shortcode($product_description); } else { the_content(); } ?>
I’m not sure how to get the content from the new description box at the front-end of the product page. If some one has a clue let me know!
Best
JoostAugust 28, 2013 at 9:31 pm #18738Hi,
Thanks for the heads. I keep this for other users, if it helps them..
Thanks,
laranz.August 30, 2013 at 10:59 am #19066Fantastic guide, thank you!
October 12, 2013 at 4:06 pm #26431anyone had any luck?
October 15, 2013 at 2:15 am #26704December 3, 2013 at 12:40 pm #35010Somebody was able to make it work? and finish it up?
December 4, 2013 at 7:22 pm #35306Hi @imweird,
What do you mean, you found any problems in the code?
Let me know, what you got.
Thanks,
laranz.December 5, 2013 at 1:02 pm #35478nope. this is the problem.
Now you have 2 description fields, with the same content in it, only thing I didn’t manage to find out was how to get the content in the new description field because when I put in some text in the backend I see the same text…
I have followed the suggested method described by the user huntingensemble
As him, I ended up having another toggle accordion / extra section (a clone of the description toggle) and the relative box for editing it in the front-end in the single product page – but when i write something in it, the description does not appear.
Something is missing
December 5, 2013 at 11:25 pm #35649Hi,
You can ask the @huntingensemble about that, He will reply you when he get a reply to this thread, because he is he one who writes the code.
Thanks,
laranz.January 5, 2014 at 12:55 pm #40438@huntingensemble did you manage to add another box under ‘Product Meta’ for your new description field?
January 5, 2014 at 12:57 pm #40439@michaelagwunobi21 Hi, no I decided to do something else. I placed the description that is underneath the photo and put it in stead of the acordion slider…
January 5, 2014 at 1:04 pm #40441@huntingensemble what is your website?
January 8, 2014 at 1:38 pm #41043If you copied the product description code snippet you’ll have to add another ID for the copied code because if both snippets have the id
‘id’ => “{$prefix}product_description”,
they will clash.
For example call it
‘id’ => “{$prefix}product_description_two”,
Then in the front end you will add
echo do_shortcode($product_description_two);
instead of
echo do_shortcode($product_description);
January 17, 2014 at 10:07 am #43192This reply has been marked as private.January 17, 2014 at 9:19 pm #43291This reply has been marked as private. -
Posted in: Neighborhood
You must be logged in and have valid license to reply to this topic.