Wrox Programmer Forums
|
BOOK: Professional WordPress
This is the forum to discuss the Wrox book Professional WordPress by Hal Stern, David Damstra, Brad Williams; ISBN: 9780470560549
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional WordPress section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 1st, 2017, 12:55 AM
Registered User
 
Join Date: Jun 2017
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default get current term id for attribute_pa_color

Hi, I’m trying to convert the selected color on my product pages dropdown box to a PHP variable to use in a custom price table.
I’ve tried using $wpdb but can’t figure out how to get the current term id for attribute_pa_color. It works if I manually put the colors term id in. the same happens when I try to use new WP Query () and SQL code.
I can convert to PHP when I use JQuery with a hidden form. This changes the price table to the correct selected color but the image then defaults back to the original default value so the price table and colored image don’t match.
I’ve tried XMLHttpRequest() but of course it sends the variable back as HTML. I tried processing the entire table in the XMLHttpRequest() PHP file. This will send the correct color back but will not process the same php code that I use in my other files. I’ve tried calling the header, footer and other files into this file to get the php to work but it even rejects these requests.
I’ve used many varieties of get_the_terms($product->id, 'pa_color') but I get all the colors for that product not the selected one. Again, I’m new at coding and WordPress and would appreciate any help with this.





Similar Threads
Thread Thread Starter Forum Replies Last Post
SQL Term help Jt13tbone13 BOOK: Beginning T-SQL with Microsoft SQL Server 2005 and 2008 ISBN: 978-0-470-25703-6 0 September 15th, 2011 02:34 PM
term.h / curses.h / ncurses.h Do not exist suby-luby BOOK: Beginning Linux Programming, 4th Edition ISBN 978-0-470-14762-7 1 August 12th, 2008 12:59 AM
marshalas term in vb.net PankajGarg10 General .NET 1 April 13th, 2007 08:05 AM
Ch. 6 - Term Extraction Example ddouglas BOOK: Professional SQL Server 2005 Integration Services ISBN: 0-7645-8435-9 0 March 20th, 2006 05:11 AM
How do I get my current client Session id ? badgolfer ASP.NET 1.0 and 1.1 Basics 1 October 25th, 2004 08:02 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.