Can’t Insert Image into Product Content – Insert into Post button missing [FIX]

This topic is: not resolved

This topic contains 9 replies, has 6 voices, and was last updated by  beforeyoucansay 1 year, 8 months ago.

Viewing 10 posts - 1 through 10 (of 10 total)
Author Posts
Author Posts
April 5, 2011 at 7:19 pm #103635

reidwalley

WordPress version: 3.1
WordPress theme: Twenty Ten 1.2
WP e-Commerce version: 3.8

Problem:

The “Insert into Post” button is missing when trying to insert a product image into a WP e-Commerce Product Page

Solution:

File: root/wp-content/plugins/wp-e-commerce/wpsc-admin/includes/display-items-functions.php

Line 1102:

Change

td.savesend input.button {
display: none;
}

To

td.savesend input.button {
display: block;
}

WARNING: I have no idea what type of consequence this edit will have on your WordPress installation or if it will conflict with your theme.

April 23, 2011 at 7:08 am #103636

one3rdnerd
New Member

Cheers Reid, I have done this and it fixes the issue for me in Thesis.

Any ideas why it is like this? is this the same for all themes or?
Can it be fixed so I dont have to edit this file?

April 29, 2011 at 12:52 am #103637

one3rdnerd
New Member

Hi Reid,

I have an improvement on your fix, depending on how you are doing things. Instead of hacking that core file, I decided to make this hack in my theme files. I use custom_functions.php instead of the usual functions.php as I am working with Thesis.

So I copied the function from the file you referred me to, and added a 2 on the end of its name so it didnt load the same function twice and crash the site. I then removed any of the styles and parts that were not necessary for this fix to keep it small and tidy and hooked it into my admin.

See below, this way each time I upgrade wpec this fix should remain intact. ;)

function wpsc_gallery_css_mods2() {
	print '<style type="text/css">
			td.savesend input.button {
				display:block !important;
			}
	</style>';
	}
add_action('init', 'wpsc_gallery_css_mods2');
April 29, 2011 at 1:42 am #103638

one3rdnerd
New Member

One issue I did notice on this is that I get a

Warning: Cannot modify header information – headers already sent by (output started at wp-content/themes/thesis_18/custom/custom_functions.php:69) in wp-includes/class-wp-ajax-response.php on line 129

On the add product page, however everything seems to work other than that. Anyone have any ideas? does who init functions do that? I thought there were tonnes?

Cheers

April 29, 2011 at 2:26 am #103639

Lee Willis
Resident Expert
Trusted

I suspect that the reason for this is so that people don’t hit “Insert into Post” instead of actually assigning the image as a product thumbnail….

I agree it’s a bit annoying though …

April 29, 2011 at 2:35 am #103640

one3rdnerd
New Member

Yeah I know what you mean, but could it not be modified to show after a check has been done to see if the user got there via the insert image button above the WYSIWYG

or

Be modified so it had a *note – this option is for inserting multiple images into the content area, not for setting the main product image notice?

There must be a way around it because its a pain in the butt. Some people don’t want to use the gold cart approach for multiple images and want to be able to float them throughout the content, especially with product demonstration image sets etc.

Any thoughts why my init function above creates a header error? apart from the error I am happy with my solution for now. Cheers Lee.

May 3, 2011 at 2:15 pm #103641

aidan
New Member

If you use the solution provided by one3rdnerd, you should use a more appropriate hook such as admin_head because hooking it into init places the style tag before DOCTYPE and breaks the HTML for your entire website!

function wpsc_gallery_css_mods2() {
	print '<style type="text/css">
			td.savesend input.button {
				display:block !important;
			}
	</style>';
	}
add_action('admin_head', 'wpsc_gallery_css_mods2');
May 3, 2011 at 10:30 pm #103642

one3rdnerd
New Member

Good call Aidan, I wasn’t sure it would work if in another hook so thank for confirming. I will try this in a moment. My solution didn’t break the front end, but caused several issues with the admin back end. Cheers, I think this is a great function for the community. :)

June 15, 2011 at 5:32 pm #103643

mongkolbest

If i want to WP EC show plugin
Faster Image insert

like post or page how can i change it code ?

September 9, 2011 at 12:26 pm #224141

beforeyoucansay
Contributor

I have also had this problem and ended up using this fix, which by all means isn’t perfect, but it certainly saved my ass. Thanks a lot.

Viewing 10 posts - 1 through 10 (of 10 total)

The forum ‘3.8 Stable Release’ is closed to new topics and replies.