Forum Replies Created
-
AuthorPosts
-
September 18, 2010 at 6:30 am in reply to: Why Configure Every Product Separately When Used with NextGen Gallery #18631Arrow325Member
Okay, I got figured out. The alignment issues were were caused by the “$ngg2Image” reference in eStore_misc_functions.php: apparently the placement matters. When it was the last item listed (afer $button_type), the alignment was wrong. To make everything be properly aligned, I had to enter it like this:
function get_variation_and_input_code($ret_product,$ngg2Image,$line_break=true,$button_type=1)
Now the only remaining problem is a colon appearing between the variable option dropdowns and the Add To Cart button. I’m pretty sure it is the colon that came after the title of the Input field, but I can’t seem to find it in the eStore css.
September 18, 2010 at 1:07 am in reply to: Why Configure Every Product Separately When Used with NextGen Gallery #18630Arrow325MemberThanks! I found the trouble in gallery-wp-eStore-addtocart.php. I had to replace “<span><?php echo $image->caption ?></span>”
with the code new span:
“<span class=”prod_detail”><?php echo $image->alttext ?><?php echo get_button_code_for_product(1,$image); ?></span>”
I had originally just added the new stuff in, leaving the old code in there too. Correcting that fixed the error message I was getting, but now I have another issue.
The alttext, variable options, and Add To Cart button are now in-line instead of being separated by line breaks. It also looks like the div for the thumbnail extends several inches to the right or the image border.
You can see an example here: http://thinktankgallery.com/?page_id=68
I tried to use the original short code [nggallery id=1 template=wp-eStore] so I could inspect the elements with Firebug and see what I could see, but when I use that shortcode I get the same error message I was getting before the aforementioned edit to gallery-wp-eStore-addtocart.php.
Thanks for your help! I really appreciate you taking the time to help me out.
September 17, 2010 at 10:04 pm in reply to: Why Configure Every Product Separately When Used with NextGen Gallery #18628Arrow325MemberI copied gallery-wp-eStore.php and and renamed it “gallery-wp-eStore-addtocart.php”. I then added the following code to the “addtocart” file per step 1 from Parris’ post:
<span class=”prod_detail”><?php echo $image->alttext ?><?php echo get_button_code_for_product(1,$image); ?></span>
and I put that in the /view folder for the nextgen plugin. I believe that is what you meant by creating a new NG Gallery view template? I apologize if I misunderstood, I’m not very good with php.
Line 90 of eStore_misc_functions.php is as follows:
function get_button_code_for_product($id,$image)
The rest of the code for the function on line 90 is in the previous post.
Thanks!
September 17, 2010 at 7:20 pm in reply to: Why Configure Every Product Separately When Used with NextGen Gallery #18626Arrow325MemberI’m trying to make this same modification. I’m on version 4.3.3, so that might be the problem. I went through the steps that Parris outlined, updating eStore_misc_functions.php and eStore_button_display_helper.php, and then I put the shortcode “[nggallery id=1 template=wp-eStore-addtocart]” in my gallery.
But I get this error above the images, repeated twice:
“Warning: Missing argument 2 for get_button_code_for_product(), called in /home/arrow325/public_html/wp-content/plugins/wp-cart-for-digital-products/wp_eStore1.php on line 803 and defined in /home/arrow325/public_html/wp-content/plugins/wp-cart-for-digital-products/eStore_misc_functions.php on line 90”
I checked the referenced code, but I don’t know enough to understand what the problem is. Here is the referenced code (specific lines are bold):
wp_eStore1.php:
function print_wp_digi_cart_button($content)
{
$pattern = ‘#[wp_eStore:product_id:.+:end]#’;
preg_match_all ($pattern, $content, $matches);
foreach ($matches[0] as $match)
{
$pattern = ‘[wp_eStore:product_id:’;
$m = str_replace ($pattern, ”, $match);
$pattern = ‘:end]’;
$m = str_replace ($pattern, ”, $m);
$pieces = explode(‘|’,$m);
$key = $pieces[0];
if (sizeof($pieces) == 1)
{
$replacement = get_button_code_for_product($key);
$content = str_replace ($match, $replacement, $content);
}
}
return $content;
}
eStore_misc_functions.php:
function get_button_code_for_product($id,$image)
{
global $wpdb;
$products_table_name = WP_ESTORE_PRODUCTS_TABLE_NAME;
$ret_product = $wpdb->get_row(“SELECT * FROM $products_table_name WHERE id = ‘$id'”, OBJECT);
$output = get_button_code_for_element($ret_product,”,$image);
return $output;
}
You can see this error in action here: http://thinktankgallery.com/?page_id=68
Any help would be greatly appreciated!
-
AuthorPosts