Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New to the CF scene
    Join Date
    May 2011
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    PHP Notice: Undefined property:

    Sorry if this has been covered a million times and for being a total PHP n00b, but I'm not sure how to fix this issue.

    I get a

    PHP Notice: Undefined property: JAdministrator::$_SHIPPING in /Applications/MAMP/htdocs/bodylace/administrator/components/com_virtuemart/classes/ps_checkout.php on line 2100

    The code is

    Code:
    // Shipping Details
    		if( is_object($this->_SHIPPING) ) {
    			$shopper_message .= "\n\n------------------------------------------------------------------------\n";
    			$shopper_message .= $VM_LANG->_('PHPSHOP_ORDER_PRINT_SHIPPING_LBL',false).":\n";
    			$shopper_message .= $shipping_arr[1]." (".$shipping_arr[2].")";
    		}

    I'm also getting the error message on another bit of code farther down the page
    Code:
    if( is_object($this->_SHIPPING) ) {
    				$shipping_info_details = stripslashes($shipping_arr[1])." (".stripslashes($shipping_arr[2]).")";
    			}
    			else {
    				$shipping_info_details = ' ./. ';
    			}
    I have read that I need to define the property which I assume is $_SHIPPING, however, I also see this in the beginning of the file

    Code:
    class vm_ps_checkout {
    	var $_SHIPPING = null;
    	var $_subtotal = null;
    	var $_shipping = null;
    	var $_shipping_tax = null;
    	var $_payment_discount = null;
    	var $_coupon_discount = null;
    	var $_order_total = null;
    	/** @var string An md5 hash of print_r( $cart, true ) to check wether the checkout values have to be renewed */
    	var $_cartHash;
    How do I fix this error?

  • #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,987
    Thanks
    4
    Thanked 2,660 Times in 2,629 Posts
    Quote Originally Posted by dorys View Post
    PHP Notice: Undefined property: JAdministrator::$_SHIPPING in /Applications/MAMP/htdocs/bodylace/administrator/components/com_virtuemart/classes/ps_checkout.php on line 2100
    These classes do not match: vm_ps_checkout.
    The error states the scope in which you are accessing _SHIPPING is that of JAdministrator, but that member if defined in vm_ps_checkout. That indicates that the access to $this->_SHIPPING should probably be accessing a different member's _SHIPPING (ie: $this->my_ps_checkout_var->_SHIPPING) instead.

  • #3
    New to the CF scene
    Join Date
    May 2011
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Fou-Lu View Post
    These classes do not match: vm_ps_checkout.
    The error states the scope in which you are accessing _SHIPPING is that of JAdministrator, but that member if defined in vm_ps_checkout. That indicates that the access to $this->_SHIPPING should probably be accessing a different member's _SHIPPING (ie: $this->my_ps_checkout_var->_SHIPPING) instead.
    Thank you. If I understand correctly should I be adding my_ps_checkout_var-> into line 2100?

    If so, I tried that and received another undefined property error, plus "Trying to get property of non-object" warning.

  • #4
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,987
    Thanks
    4
    Thanked 2,660 Times in 2,629 Posts
    Quote Originally Posted by dorys View Post
    Thank you. If I understand correctly should I be adding my_ps_checkout_var-> into line 2100?

    If so, I tried that and received another undefined property error, plus "Trying to get property of non-object" warning.
    No, what I'm saying is that the scope where you are calling _SHIPPING is invalid. Class JAdministrator does not contain a member of that name (although PHP will allow you to construct members at runtime, which is honestly the single stupidest thing I've ever seen zend do), so I presumed that another member within JAdministrator is an object that does. This may or may not actually be the case, as I have no idea if or when the class vm_ps_checkout is added to be accessed by the JAdministrator class.

    You need to determine where _SHIPPING is actually supposed to be called, or on what object the _SHIPPING is actually stored within that class. You can view an object's data via var_dump($obj). This will work on $this, and can be used to evaluate the members of the class to determine which if any of them include the _SHIPPING member.

  • #5
    New to the CF scene
    Join Date
    May 2011
    Location
    Lithuania
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi,

    Should I include var_dump in the same file where _Shipping code is?
    Where and when output of the dumps will go?

    Thanks

    Quote Originally Posted by Fou-Lu View Post
    No, what I'm saying is that the scope where you are calling _SHIPPING is invalid. Class JAdministrator does not contain a member of that name (although PHP will allow you to construct members at runtime, which is honestly the single stupidest thing I've ever seen zend do), so I presumed that another member within JAdministrator is an object that does. This may or may not actually be the case, as I have no idea if or when the class vm_ps_checkout is added to be accessed by the JAdministrator class.

    You need to determine where _SHIPPING is actually supposed to be called, or on what object the _SHIPPING is actually stored within that class. You can view an object's data via var_dump($obj). This will work on $this, and can be used to evaluate the members of the class to determine which if any of them include the _SHIPPING member.

  • #6
    New to the CF scene
    Join Date
    May 2011
    Location
    Lithuania
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi,

    This problem is related to Virtuemart file ps_checkout and I have made a dump of that file and here is dump output:

    [ps_checkout object] Variable Name
    Properties
    [null] _SHIPPING
    [string] _cartHash = "900556ee735af6233f51a3353e77ba0b"
    [null] _coupon_discount
    [null] _order_total
    [null] _payment_discount
    [null] _shipping
    [null] _shipping_tax
    [double] _subtotal = 71.2
    Methods
    _tax_based_on_vendor_address
    add
    approx
    asterisk_pad
    calc_order_shipping
    calc_order_shipping_tax
    calc_order_subtotal
    calc_order_tax
    calc_order_taxable
    calc_order_totals
    country_in_eu_common_vat_zone
    display_address
    email_receipt
    generate_cart_hash
    get_checkout_steps
    get_current_stage
    get_new_cart_hash
    get_order_number
    get_order_subtotal
    get_order_total
    get_payment_discount
    get_vendor_currency
    list_addresses
    list_payment_methods
    list_shipping_methods
    noShipToNecessary
    noShippingMethodNecessary
    noShippingNecessary
    process
    ship_to_addresses_radio
    show_checkout_bar
    show_tax_details
    tax_based_on_vendor_address
    update
    validate_add
    validate_form
    validate_payment_method
    validate_shipping_method
    validate_shipto
    vm_ps_checkout


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •