Excuus voor mijn late reactie maar ik was even druk met wat andere dingen.
Bij deze dus:
Ik ben er niet zeker van of ik je begrijp maar de code waaruit de foutmelding komt staat hieronder:
Dit is een stukje uit een bestand met allerlei functies. Van de code in dit bestand begrijp ik niet zoveel.
<?php
/**
* AJAX: remove from wishlist action
*
* @return void
* @since 1.0.0
*/
public function remove_from_wishlist_ajax() {
$wishlist_token = isset( $this->details['wishlist_token'] ) ? $this->details['wishlist_token'] : false;
$count = yith_wcwl_count_products( $wishlist_token );
$message = '';
if( $count != 0 ) {
if ( $this->remove() ) {
$message = apply_filters( 'yith_wcwl_product_removed_text', __( 'Product successfully removed.', 'yith-woocommerce-wishlist' ) );
$count --;
}
else {
$message = apply_filters( 'yith_wcwl_unable_to_remove_product_message', __( 'Error. Unable to remove the product from the wishlist.', 'yith-woocommerce-wishlist' ) );
}
}
else{
$message = apply_filters( 'yith_wcwl_no_product_to_remove_message', __( 'No products were added to the wishlist', 'yith-woocommerce-wishlist' ) );
}
wc_add_notice( $message );
$atts = array( 'wishlist_id' => $wishlist_token );
if( isset( $this->details['pagination'] ) ){
$atts['pagination'] = $this->details['pagination'];
}
if( isset( $this->details['per_page'] ) ){
$atts['per_page'] = $this->details['per_page'];
}
echo YITH_WCWL_Shortcode::wishlist( $atts );
die();
}
?>
De masonry is geen plugin, ik kwam het tegen tijdens een online training op Lynda.com. Daar werd het toegepast.
Ik heb de scripts hier gedownload:
http://masonry.desandro.com/
Ik ben deze site hier lokaal aan het bouwen. Als het moet kan ik wel voor een online versie zorgen. We moeten dan alleen even kijken hoe we inloggegevens bij je krijgen.
Bedankt.
[size=xsmall]
Toevoeging op 19/11/2015 10:18:59:[/size]
Een aanvulling:
Wanneer ik de link
http://stockphotosite.dev/wishlist/?remove_from_wishlist=4178 rechtstreeks in mijn browseradresveld plak wordt het product correct, zonder foutmelding verwijderd. Hierbij is stockphotosite.dev mijn lokale omgeving en 4178 het product_id dat wordt gegeven door de wishlist plugin.
Het echte verwijderen van een product lijkt door de onderstaande functie te worden uitgevoerd.
<?PHP
/**
* Remove an entry from the wishlist.
*
* @return bool
* @since 1.0.0
*/
public function remove( $id = false ) {
global $wpdb;
if( ! empty( $id ) ) {
_deprecated_argument( 'YITH_WCWL->remove()', '2.0.0', __( 'The "Remove" option now does not require any parameter' ) );
}
$prod_id = ( isset( $this->details['remove_from_wishlist'] ) && is_numeric( $this->details['remove_from_wishlist'] ) ) ? $this->details['remove_from_wishlist'] : false;
$wishlist_id = ( isset( $this->details['wishlist_id'] ) && is_numeric( $this->details['wishlist_id'] ) ) ? $this->details['wishlist_id'] : false;
$user_id = ( ! empty( $this->details['user_id'] ) ) ? $this->details['user_id'] : false;
if( $prod_id == false ){
return false;
}
if ( is_user_logged_in() ) {
$sql = "DELETE FROM {$wpdb->yith_wcwl_items} WHERE user_id = %d AND prod_id = %d";
$sql_args = array(
$user_id,
$prod_id
);
if( empty( $wishlist_id ) ){
$wishlist_id = $this->generate_default_wishlist( get_current_user_id() );
}
$wishlist = $this->get_wishlist_detail( $wishlist_id );
$this->last_operation_token = $wishlist['wishlist_token'];
$sql .= " AND wishlist_id = %d";
$sql_args[] = $wishlist_id;
$result = $wpdb->query( $wpdb->prepare( $sql, $sql_args ) );
if ( $result ) {
return true;
}
else {
$this->errors[] = __( 'An error occurred while removing products from the wishlist', 'yith-woocommerce-wishlist' );
return false;
}
}
else {
$wishlist = yith_getcookie( 'yith_wcwl_products' );
foreach( $wishlist as $key => $item ){
if( $item['wishlist_id'] == $wishlist_id && $item['prod_id'] == $prod_id ){
unset( $wishlist[ $key ] );
}
}
yith_setcookie( 'yith_wcwl_products', $wishlist );
return true;
}
}
?>
Kan het een AJAX gerelateerd probleem zijn? Als ik namelijk na de verwijderpoging waarbij ik een foutmelding krijg opnieuw naar de url kijk in de html output dan is deze veranderd naar:
http://stockphotosite.dev/wp-admin/admin-ajax.php?remove_from_wishlist=4178. Ik weet echter helemaal niets van AJAX.
Dat komt op mij vreemd over.....