K, I tried email jonny with no response.. dark matter, any help? I went through and tried the whole process over again with the same result...thank you all, I really appreciate any help!
Why Configure Every Product Separately When Used with NextGen Gallery
(99 posts) (14 voices)-
Posted 1 year ago #
-
I'd be happy to help, but this weekend's a little hectic. I'll PM you.
Posted 1 year ago # -
Nevermind, thought I could PM you here haha. Shoot me an email vince@utopiastudios.net with your MSN or Yahoo.
Posted 1 year ago # -
Tracey I dont use that address for actual email, hense why I said to add me on msn messenger.
Posted 1 year ago # -
wow, i'm all set.. thank you so much jonny for all of your help!!!
Posted 1 year ago # -
Hi Folks,
Would anyone who has got this modification working be willing to help me get it running? I think I'm probably just missing some small detail somewhere. The testing site for my project is littlegraphicsengine.com/wpcms/main-gallery
As you should see on the page (linked above), I have the name of the file showing to the left of the variations dropdown, the customer field is showing up on the second line (with the default label of "Instructions"), and I have an "Add to Cart" button graphic on the third line. I just don't have the customer field populated with the file name (which I think is what needs to happen for the file name to get passed to the cart. Right?)
I'm not a PHP coder but I think I've been able to follow the basic logic. Here's what I've done following Dark Matter's instructions and various other member's snippets in this thread (while I'm at it, I figure I'll try and include a good level of detail so we'll have a more complete step by step. So sorry in advance for the long post):
1. Starting in the plugins directory of my Wordpress installation, I made a copy of gallery-wp-eStore.php (from \wp-cart-for-digital-products\view\) , renamed it "gallery-wp-eStore-addtocart.php" and put it in \nextgen-gallery\view. I then added this code to wp-eStore-addtocart.php just after the closing "/a" html tag in the Thumbnails section:
<span class="prod_detail"><?php echo $image->alttext ?><?php echo get_button_code_for_product(1,$image); ?></span>2a.In \wp-cart-for-digital-products\ I modified eStore_misc_functions.php, adding the $image variable to the existing function so that it now look like this:
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; }($image added in two places) and adding $ngg2Image='' to this other function here:
function get_button_code_for_element($ret_product,$line_break=true,$ngg2Image='')
and adding $ngg2Image further down in this same function so it looks like this:
$var_output = get_variation_and_input_code($ret_product,$line_break,$ngg2Image);2b. Also in \wp-cart-for-digital-products\ I modified eStore_button_display_helper.php, adding the $ngg2Image variable to an existing function so that it now looks like this:
function get_variation_and_input_code($ret_product,$line_break=true,$ngg2Image,$button_type=1)Then towards the bottom of the function, I added $ngg2Image so that it looks like this:
$var_output .= $ret_product->custom_input_label.': <input type="text" name="custom_input" value="'.$nggImage->alttext.'" class="eStore_text_input" />';3. I have a gallery of pictures set up using NextGen.
4. I created a new product in eStore with "Collect Customer Input" checked and left the Field Label blank ( in the "Additional Product Details" section), set a Product Price of 0.00 and added my variations.
5. I have the shortcode [nggallery id=1 template=wp-eStore-addtocart] in a page called Landscapes (1 is the gallery ID number for my gallery, also called Landscapes).
6. Following the standard instructions for NextGen gallery and eStore I have these settings as well:
Under Gallery (NextGen settings), in "Manage Gallery", I have my gallery "Landscapes" with Page Link to "Landscapes" (the page with this name). Also, since I have this gallery in an album and want the album thumbnails to link to the actual page where my "Add to Cart" buttons show up (and not the gallery url that NextGen gallery assigns to Album thumbs by default), I have "Deactivate gallery page link:" unchecked (in Options/Gallery tab).
Then for eStore's settings I have an Add To Cart button link set (in Settings/General Settings (Add to Cart button text or Image). Also I have "Product ID to be Used as a Template" set to 1 (in WP eStore Settings/3rd Party Integration/NextGen Gallery Settings (1 is the ID of my product that I'm using as a template).
7. Once the file name is showing up in the field properly, then the field needs to be hidden so customers won't accidentally put something else in there. I think it's a simple matter of hiding the field with CSS (which I can figure out). But I don't remember how to do that at the moment, so if anyone wants to chime in about that, please do! Otherwise I'll add it to this Step by Step later, once I get things working.
Ok, I think that is it, minus whatever crucial bit I'm missing (as it's not yet working [customer field not getting populated with the file name of the image], which is why I need help).
Thanks!
Posted 1 year ago # -
@ Parris
Re: item 2a, $ngg2Image='' gets added here:
function get_button_code_for_element($ret_product,$line_break=true,$ngg2Image='')
and here
$var_output = get_variation_and_input_code($ret_product,$line_break,$ngg2Image);
$image also exists here:
function print_eStore_ngg_buy_now($image)
{
$output = "";
$product_id = get_option('eStore_ngg_template_product_id');
if(empty($product_id))
{
$output .= "You need to specify a product ID in the 3rd Party Settings of eStore";
}
else
{
$output .= print_eStore_buy_now_button($product_id,'',$image);
}
return $output;
}...but I can't recall if that was already there in the original file, perhaps. either way it needs to be there.
Re: item 2b, your code is missing the "2" in "$ngg2Image" as such:
'<input type="text" name="custom_input" value="'.$ngg2Image->alttext.'" class="eStore_text_input" />'
Check, correct and test and let me know if that solved it.
Then, to hide the field, in teh eStore css file, I used:
.eStore_text_input {
font-size:1.3em;
height:0px;
width: 0px;
color:#444;
background:#eee;
border:0px solid #aaa;
border-right-color:#ddd;
border-bottom-color:#ddd;
margin:0px auto 0px
}.eStore_text_input:focus {
height:0px;
background:#fff;
border-color:#777 #ccc #ccc #777;
margin:2px
}Try that!
Vince aka Darkmatter
Posted 1 year ago # -
I just thought I should add that I saw on page 6 and 7 of this thread (dark matter and jonnylaris's posts) that there was a concern that the version of eStore might be an issue. I think it was decided that it doesn't matter. However, just in case, my version is 4.2.7
Posted 1 year ago # -
dark matter -
Wow. Your response was fast. I can't believe you read through my long post already and replied noting my error(s). This is Great! I will correct, test, and let you know. Thanks.
Posted 1 year ago # -
@dark matter
Well I fixed my missing "2" in eStore_button_display_helper.php so that it reads:
$var_output .= $ret_product->custom_input_label.': <input type="text" name="custom_input" value="'.$ngg2Image->alttext.'" class="eStore_text_input" />';That was the only thing I could find to correct since the $image references you mentioned do exist already in the original code.
I'm afraid I still don't have anything showing up inside the field. Is that what you see?
Posted 1 year ago #
Reply »
You must log in to post.