Home › Support › Image Store › Email Favorites
-
AuthorPosts
-
November 13, 2013 at 4:17 am #55294chrisbParticipant
I often sell a sitting which includes x number of web based images.
I use Image Store to give customers a preview of their gallery from which they can then choose the images they would like to select.
I’ve often thought it would be really nice to have a function where the Customer saves their chosen images to the Favorites and can then email me with these Favorites.
I’ve just managed to hack ImStore to do this, so either could a tidied up version be included in a future release OR for others who want to apply this hack, here it is:
**** in the File – image-store/admin/ajax.php
// Add the following function
/**
** Function to email favorites to a predetermined email address
*
**/
function ajax_ims_email_favorite_images( ) {
check_ajax_referer( “ims_ajax_favorites” );if ( empty( $_GET[‘action’] ) )
die( );if ( empty( $_GET[‘imgids’] ) ) {
echo __( ‘Please, select an image’, ‘ims’ ) . ‘|ims-error’;
die( );
}$dec_ids = array( );
$action = $_GET[‘action’];
$new = explode( ‘,’, $_GET[‘imgids’] );
$subject = ‘Favorites’;
$to = ‘[email protected]’;
$message = ‘These favorites have been sent to you by someone.’.”\r\n”;
$headers = ‘From: [email protected]’ . “\r\n” .
‘Reply-To: [email protected]’ . “\r\n” .
‘X-Mailer: PHP/’ . phpversion();global $ImStore, $user_ID;
foreach ( $new as $id )
$message.=$ImStore->url_decrypt( $id ).”\r\n”;$message.=”== [END] ==”;
if ( mail($to, $subject, $message, $headers) )
echo __( ‘Favorites emailed successfully’, ‘ims’ ).’|ims-success|’ . count( $new );
else
echo __( ‘Email Failed’, ‘ims’ );
}**** Near the bottom add the following to the case statement
case ’email-favorites’: //**CB
ajax_ims_email_favorite_images( );
break;*** in the file image-store/_inc_store.php
**** change the lines
if( $this->opts[‘favorites’] && $this->imspage == ‘favorites’ )
$this->subnav[‘remove-from-favorite’] = __( “Remove”, ‘ims’ );
**** to this
if( $this->opts[‘favorites’] && $this->imspage == ‘favorites’ ) {//**CB
$this->subnav[‘remove-from-favorite’] = __( “Remove”, ‘ims’ );
$this->subnav[’email-favorite’] = __( “Email”, ‘ims’ );
}**** Then grab the store.js from my site and copy it into image-store/_js from here
http://snipt.org/Bagje4Hopefully that should then work …
-
AuthorPosts
- You must be logged in to reply to this topic.