customer

How to create Customer programmatically?

左心房为你撑大大i 提交于 2021-02-17 02:45:53
问题 I am using Odoo 13 and trying to create customer programmatically with the help of res.partner but unable to create customer. Contact is creating but as a individual not as a customer. But in Odoo 12 there is a binary field customer which differentiate other contacts from customer but it is not present in Odoo 13. Any suggestion or better idea and any help ? 回答1: The fields were removed completely in V13. With module/app account two new fields will be created: customer_rank and supplier_rank

Hiding prices based on visitor location backend bug in Woocommerce

一个人想着一个人 提交于 2019-12-19 11:25:54
问题 In my last question I asked how to hide prices to visitors outside the UK. Based off of an answer I used this code successfully add_filter( 'woocommerce_get_price_html', 'country_geolocated_based_hide_price', 10, 2 ); function country_geolocated_based_hide_price( $price, $product ) { if( get_current_user_id() > 0 ) { $country = WC()->customer->get_billing_country(); } else { // Get an instance of the WC_Geolocation object class $geo_instance = new WC_Geolocation(); // Get geolocated user geo

Magento 2 - Get Customer Address Id through Shipping Address at Checkout Session

梦想的初衷 提交于 2019-12-11 17:36:48
问题 I'm having trouble with getting customer address Id as it returns a null value. This is what I have tried: $checkout = $this->_sessionCheckout->getQuote(); if ($checkout) { $shippingAddress = $checkout->getShippingAddress(); if ($shippingAddress) { $addressId = $shippingAddress->getCustomerAddressId(); $this->_logger->log(100, print_r('address Id: ' . $addressId , true)); //Returns null /** @var \Magento\Customer\Api\Data\AddressInterface $address */ $address = $this->_addressRepository-

How to change Customer Id and Order ID?

泪湿孤枕 提交于 2019-12-11 04:09:07
问题 Currently CustomerID's start at 1 while the first Order generated has OrderID 100000001 . Is there any way of altering these fields, so the first customer created has customer number 900000001 and the first order created has OrderID 900000001 ? 回答1: By changing the increment_last_id in eav_entity_store table, you can control the starting number of customer number, Order Number, Invoice Number, and shipping Memo Id. 回答2: Paste this code to Phpmyadmin to change the Order Number UPDATE eav

How to update customer TIN Number in Opncart

被刻印的时光 ゝ 提交于 2019-12-10 12:03:00
问题 Am new in Opencart MVC , I have page called my_account.tpl. In this page am displaying customer name and tin_number . If customers want to change their tin_number just fill the TIN Number field and click save, it will update oc_customer tabel. I tried but data's not update. Following view, model and controller codes View: my_account.tpl <form action="<?php echo $action;?>" method="POST" enctype="multipart/form-data" class="form-horizontal"> <div class="col-md-9 col-lg-6 col-sm-12"> <?php

Get the customer ID from an order ID in WooCommerce

蹲街弑〆低调 提交于 2019-12-09 06:35:20
问题 I want to get the "mycred" balance of a customer through the order while using WP ALL Export to export the customer balance based on orders to a spreadsheet. It's actually probably quite simple. I'm able to get the Order ID, but not the Customer ID Here is what I'm doing to test if I can get the customer ID: function get_customeruserid($value) { global $woocommerce, $post; $order = new WC_Order($post->ID); $order_id = $order->get_order_number(); $customer = new WC_Customer($post->ID); $user

Get the customer ID from an order ID in WooCommerce

旧时模样 提交于 2019-12-03 07:45:14
I want to get the "mycred" balance of a customer through the order while using WP ALL Export to export the customer balance based on orders to a spreadsheet. It's actually probably quite simple. I'm able to get the Order ID, but not the Customer ID Here is what I'm doing to test if I can get the customer ID: function get_customeruserid($value) { global $woocommerce, $post; $order = new WC_Order($post->ID); $order_id = $order->get_order_number(); $customer = new WC_Customer($post->ID); $user_id = $customer->get_ID(); $value = $user_id; return $value; } This returns a 0. However, I can get the

Hiding prices based on visitor location backend bug in Woocommerce

岁酱吖の 提交于 2019-12-01 13:27:39
In my last question I asked how to hide prices to visitors outside the UK. Based off of an answer I used this code successfully add_filter( 'woocommerce_get_price_html', 'country_geolocated_based_hide_price', 10, 2 ); function country_geolocated_based_hide_price( $price, $product ) { if( get_current_user_id() > 0 ) { $country = WC()->customer->get_billing_country(); } else { // Get an instance of the WC_Geolocation object class $geo_instance = new WC_Geolocation(); // Get geolocated user geo data. $user_geodata = $geo_instance->geolocate_ip(); // Get current user GeoIP Country $country = $user