texts: Date format missing in admin grid and admin form in magento 2 custom module?

texts:
I created a custom module to update news and stories to magento 2 website.I have the date field in my form( main.php ).

 $dateFormat = $this->_localeDate->getDateFormat(
        \IntlDateFormatter::MEDIUM
    );
 $timeFormat = $this->_localeDate->getTimeFormat(
        \IntlDateFormatter::MEDIUM
    );

 $fieldset->addField(
        'news_date',
        'date',
        [
            'name' => 'news_date',
            'label' => __('News date'),
            'title' => __('News date'),
            'date_format' => $dateFormat,
            //'time_format' => $timeFormat,
            'required' => true,
            'disabled' => $isElementDisabled
        ]
    );

My grid file is like below.

this->addColumn(
        'news_date',
        [
            'header' => __('News date'),
            'index' => 'news_date',
            'type'      => 'date',
        ]
    );

What my issue is actual saved date is not showing in grid.if i save the news for Oct 29, 2019 grid will show Oct 28, 2019.
Below attached two images.

form

Grid

What is the issue behind this? Can anyone please help me?


texts: Enforce product quantity based on attribute?

texts:
I want to make sure a customer cannot set a Quantity other than "1" for some special products. These products all have a special attribute set.

I tried to observe sales_quote_item_qty_set_after and manually set the quantity:

public function enforceQty (Varien_Event_Observer $observer)
{
    $_item = $observer->getEvent()->getItem();

    // ...

    if ($_item->getQty() > 1)
    {
        $_item->setQty(1);
    }
}

which works perfectly fine, except that when I try to get the value of said attribute, to identify my special products, I do not get the correct value:

$_product = $_item->getProduct();
$_productId = $_product->getId();
$_storeId = Mage::app()->getStore()->getId();

$val = Mage::getResourceModel('catalog/product')
        ->getAttributeRawValue($productId, 'special_attr', $storeId);

special_attr is a boolean attribute. In the HTML output of the product, it shows the correct value Yes. In the code above, $val gets set to false for some reason.

I tried several different ways to get the value of special_attr, all of them return false instead of true.

Any Idea?

Edit 1:

I just found a method returning the correct value. Sadly the value returned is language dependent.

$val = Mage::getModel('catalog/product')
        ->load($_product->getId())
        ->getAttributeText('special_attr');

Can somebody explain why this method returns the correct value, and the other does not?

Edit 2:

After crawling through the sources for getAttributeText, I found that I can get the value I'm looking for like this:

$val = Mage::getModel('catalog/product')
        ->load($_product->getId())
        ->getData('special_attr') == "1"

In addition to Question 1: Is there a way to get the actual boolean value, instead of a string value?


texts:
I have a Magento site which integrates with a Javascript based product configurator using reverse proxy on a specific CMS page. The user configures their product and then hits 'Add to Cart' at which point the Javascript app passes a parameterised querystring back to the Magento cart controller via an http request.

It works great. It looks totally seamless from the user's point of view, they have no idea the Javascript app is on another domain and server. It's based on this concept;

http://www.magentocommerce.com/wiki/4_-_themes_and_template_customization/catalog/adding_a_product_to_the_cart_via_querystring

However.....it's not secure, it would just take sniffing and manipulating the http request to alter the product price.  At the moment there is no SSL on the site as they are using Paypal offsite checkout.

  My question: What is the best way to either harden this process or
  change it so that it's more robust?

The options, as far as I can see, include the following but I'd be grateful for some more or some insight on these.

1.  Use and SSL and secure urls

Could it be as simple as doing this? I know I can extend things relatively easily so the cart uses https by default;

http://fishpig.co.uk/blog/secure-https-magento-shopping-cart.html

2.  Using URL encoding

At the moment the http request passes an unencoded querystring.  I know that you can set the Magento add to cart url as something like this;

/checkout/cart/add/uenc/aHR0cDovL2Rldi5jaXJjdWl0Z2FsbGVyeS5jb20vZGV2aWwtcy1kZW4uaHRtbA/product/29/

But I have no idea how to do that.

File: app/code/core/Mage/Checkout/Helper/Cart.php

has a getAddUrl() method which uses the constant PARAM_NAME_URL_ENCODED, which I interpret as being a backend configuration setting;

   $params = array(
        Mage_Core_Controller_Front_Action::PARAM_NAME_URL_ENCODED => Mage::helper('core')->urlEncode($continueShoppingUrl),
        'product' => $product->getId()
  );

It is set here: app/code/core/Mage/Core/Controller/Varien/Action.php (line 51). Which backend setting is that though?  Is that System->Configuration->General->Web->Secure->Use Secure URLs in Frontend?  I thought that related to https rather than encoding.

If I do use this the trouble is that urlencode is just a base64 encoding;

File: app/code/core/Mage/Core/Helper/Abstract.php

public function urlEncode($url)
{
    return strtr(base64_encode($url), '+/=', '-_,');
}

There's no salt or encryption key, it seems that it's the urlDecode method that uses getEncryptedSessionId() via the sessionUrlVar() method;

public function urlDecode($url)
{
     $url = base64_decode(strtr($url, '-_,', '+/='));
     return Mage::getSingleton('core/url')->sessionUrlVar($url);
}

I don't get this.  Surely someone could still sniff the http request, base64 decode it, change it and then re-encode it?  Why use a session ID when decoding and nothing at all when encoding?

3.  Add to cart via the Web Services API

Using the API seems like a better idea and fundamentally more secure;

http://www.magentocommerce.com/api/soap/checkout/cartProduct/cart_product.add.html

the only problem is that it's more troublesome from the Javascript side (although I did find some resources on JS integration with Magento API using titanium and nodejs for both SOAP and XML-RPC);

http://qzaidi.github.io/2011/10/16/magento-node/

https://github.com/milewise/node-soap

How to access the Magento API from native client with JavaScript

However, we already have a working implementation so I'd rather securing the existing working process if possible.


texts:
I have a block that I have overwritten but it doesn't seem to work. I saw a guide on the web and it didn't seem that difficult, but I can't seem to get it to work properly.

It's just using default - here is some code :o)

etc/config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Namespace_Bundle>
            <version>0.1.0</version>
        </Namespace_Bundle>
    </modules>

    <global>
        <blocks>
            <catalog>
                <product>
                    <view>
                        <type>
                            <bundle>
                                <rewrite>
                                    <option>Namespace_Bundle_Block_Catalog_Product_View_Type_Bundle_Option</option>
                                </rewrite>
                            </bundle>
                        </type>
                    </view>
                </product>
            </catalog>
        </blocks>
    </global>
</config>

I've created the class

class Namespace_Bundle_Block_Catalog_Product_View_Type_Bundle_Option extends Mage_Bundle_Block_Catalog_Product_View_Type_Bundle_Option{

    public function getSelectionTitlePrice($_selection, $includeContainer = true){

        return 'TEST';

    }

}

Namespace_Bundle.xml

<config>
    <modules>
        <Namespace_Bundle>
            <active>true</active>
            <codePool>local</codePool>
        </Namespace_Bundle>
    </modules>
</config>

I've checked to see that the module is active and it is.

UPDATE

Altered the config.xml to:

<rewrite>
    <product_view_type_bundle_option>Namespace_Bundle_Block_Catalog_Product_View_Type_Bundle_Option</product_view_type_bundle_option>
</rewrite>

UPDATE 2

Altered the module name to MyBundle instead - still no difference

UPDATE 3

Was not calling the right module / file


texts: Magento 2 how to get product name and qty in mini cart

texts: Magento 2 how to get product name and its qty in mini cart when we add to mini cart


texts: Designing the Custom page for the product inner page

texts:
I am new to Magento CMS and I am stuck in designing the custom product page according to the design given to me.

Can anyone say me where to design this actual layout to be done exactly. I have refereed some of the links where it say to be done the layout.xml of the custom theme. But I fear to do this. Please help me someone to achieve this.


texts: Getting 'The XML in file "module-inventory-sales/etc/communication.xml" is invalid: Element 'topic', attribute 'is_synchronous':

texts:
i had upgraded my magento from 2.2 to 2.3 , but after doing that i m getting given below error.
please let me know whats wrong


texts: Magento 2: Caches to enable for frontend dev

texts:
Most backends I've worked with usually work with most or all caches enabled. Frontend development on Magento 2 is problematic with such a configuration, since a lot of the work relies on making changes and refreshing the browser often.

I have found from personal experimentation that disabling all caches apart from config and eav allows for workable performance while still allowing changes to propagate to the frontend.

Are there any other cache configuration changes that could be made which would improve performance without impeding workflow?


texts: Where can I edit the post product review action/handler?

texts:
I'm trying to resolve this ridiculous issue that nobody can shed any light on Unable to post product reviews on secondary store site; displays recaptcha error but no recaptcha is present in form?

It's really out there, doesn't make sense, so I've got to dig deeper but Magento is so absurd to me I have no idea as to where to look. If you can please point me in the right direction while I thumb bleakly through the codebase in the meantime. Thank you.

Edit:
A post action like this is referred to by the questioner based on the other question: http://example.com/review/product/post/id/4802/ (form action when submitting a product review in frontend)


texts:
I am using Magento 2, and I have staging server, I don't want any crawler or bots to index my staging server.

So, I need whole website to be no-index, no follow. Is it possible in Magento?


texts: Format Phone Number When Displayed in Order Emails

texts: I want to format Phone Number on the emails where in it should look like 999.999.9999 when displayed in shipping address and billing address.


texts: magento2.2 - programmatically create coupon

texts:
in a magento 2.2 based site we need to programmatically create a coupon code for . However was only able to find one code sample and it does not seem to work. Meaning no coupon code is created and when I look in the exception.log file I see the below error message

  main.CRITICAL: Notice: Undefined property: Smartwave\Porto\Block\Template::$objectManager in /var/www/html/****.com/vendor/magento/framework/View/TemplateEngine/Php.php on line 110 {"exception":"[object] (Exception(code: 0):

Below is the code I am trying to use. Also as a side note the coupon code is created in the admin panel as a cart price rule.

//lets create a coupon code
$coupon['name'] = 'vip_signup';
$coupon['desc'] = 'Discount for vip signup.';
$coupon['start'] = date('Y-m-d');
$coupon['end'] = '';
$coupon['max_redemptions'] = '1';
$coupon['discount_type'] ='by_percent';
$coupon['discount_amount'] ='15';
$coupon['flag_is_free_shipping'] = 'no';
$coupon['redemptions'] = '1';
$coupon['code'] ='NL01-1234'; //this code will normally be autogenetated but i am hard coding for testing purposes

$shoppingCartPriceRule = $this->objectManager->create('Magento\SalesRule\Model\Rule');

$shoppingCartPriceRule->setName($coupon['name'])
        ->setDescription($coupon['desc'])
        ->setFromDate($coupon['start'])
        ->setToDate($coupon['end'])
        ->setUsesPerCustomer($coupon['max_redemptions'])
        ->setCustomerGroupIds(array('0','1','2','3',))
        ->setIsActive('1')
        ->setSimpleAction($coupon['discount_type'])
        ->setDiscountAmount($coupon['discount_amount'])
        ->setDiscountQty(1)
        ->setApplyToShipping($coupon['flag_is_free_shipping'])
        ->setTimesUsed($coupon['redemptions'])
        ->setWebsiteIds(array('1',))
        ->setCouponType('2')
        ->setCouponCode($coupon['code'])
        ->setUsesPerCoupon(NULL);

return $shoppingCartPriceRule->save();
       $shoppingCartPriceRule->unsetData();


texts: Magento2: Question about product scope & language

texts:
I understand you can have a website, with a store which will contain multiple storeviews. So in example the default storeview is in English and a second storeview is in German with domain (website.de). You translate the products to German within the German storeview scope.
At some point you also create a few extra German storeviews so you can also have domains like website.at and website.ch. However when you create those storeviews the following problem arises:
For the products in now falls back on the default language (english).

Is there a way to let these new storeviews use the german product descriptions? Or do I have to go through the entire catalog for both storeviews and copy paste the german descriptions?
What is the proper way to set this up? It seems creating a german store of website even does not do the trick. Within a product I can only switch scopes between 'All Store Views' and a specific storeview.

Thank you for any helpful answers.


texts: Magento 2 : Image is not showing on product detail page

texts:
I have created a product programmatically, and products are uploading successfully but image is not displaying on product detail page here a screen shot.

but image is also showing on homepage and admin area..heres a screeshot

admin area showing the product image too, but not in the detail page?
please suggest a solution.


texts: Magento2.3.0 In production mode when i go to admin category click getting error

texts:
I am using Magento2.3.0 and our website is production mode when i go to admin side in category getting error. i apply all command but it may be issue in generated folder inside because using compile command after getting issue my error comes below

Fatal error: Uncaught Error: Call to a member function setActive() on boolean in /home/XXXXX/public_html/XVXVXVXV.co.uk/vendor/magento/module-backend/Model/View/Result/Page.php:27 Stack trace: #0 /home/XXXXX/public_html/XVXVXVXV.co.uk/vendor/magento/module-catalog/Controller/Adminhtml/Category/Edit.php(105): Magento\Backend\Model\View\Result\Page->setActiveMenu('Magento_Catalog...') #1 /home/XXXXX/public_html/XVXVXVXV.co.uk/generated/code/Magento/Catalog/Controller/Adminhtml/Category/Edit/Interceptor.php(24): Magento\Catalog\Controller\Adminhtml\Category\Edit->execute() #2 /home/XXXXX/public_html/XVXVXVXV.co.uk/vendor/magento/framework/App/Action/Action.php(108): Magento\Catalog\Controller\Adminhtml\Category\Edit\Interceptor->execute() #3 /home/XXXXX/public_html/XVXVXVXV.co.uk/vendor/magento/module-backend/App/AbstractAction.php(231): Magento\Framework\App\Action\Action->dispatch(Object(Magento\Framework\App\Request\Http)) #4 /home/XXXXX/public_html/econaturalproduct in /home/XXXXX/public_html/XVXVXVXV.co.uk/vendor/magento/module-backend/Model/View/Result/Page.php on line 27

In one category below product not getting on frontend side.


texts: Custom Order Reports - Orders Purchased From Field - Fraud

texts:
When I export a report via CSV for Customer Orders, under the field Orders Purchased From, it states Admin, Default, Admin - this applies to all my known fraud orders.

Is this a default response for the Purchased From field?

Or

Does it mean the Default Admin manually entered the order?

I am not real familiar with Magento and searching frantically for answers. Any help would be greatly appreciated.

Thank you in advance!


texts: Select the customers logged the last day since an determinated hour

texts:
I want to display prommatically the last customers loggin since yesterday from 21:00 .
I think i could get this data from

  Mage::getSingleton('customer/session')->getCustomer();

  Mage::getModel('log/customer')->loadByCustomer($custom);

But can't, and i was looking for other codes and didn't found anything.


texts: Magento2 :: Need to set product out of stock for particular category when quantity decrease to 2

texts:
Magento2 Need to set products out of stock for particular category when qty is decrease to 2. For all other category is 1.
How can I achieve this?


texts: Magento2 - Lazy loading require-js top level modules per page content

texts:
Taking Luma theme on M2.2 (current develop tip), and running in production mode, loading the homepage why am I seeing jquery-ui-timepicker-addon.js being loaded when it's not used on the homepage? Im seeing over 500KB of Javascript being pulled on a homepage load which is very concerning.

This seem really non idiomatic use of require-js.


texts: how to remove "Powered by Searchanise" from the search bar

texts: I am building the magento ecommerce website named "bookslab.in". I want to remove the "Powered by Searchanise" from the search bar of my magento site. I had attached the screenshot of which section i have to remove & how much part i have to remove. I had installed an Searchanise extension. Any help will be appreciated. Someone suggested my to edit in module, but how  to edit this module. Any one know please answer this if anyone did not got i will explain them again. While accessing the Putty to connect with SSH getting "Connection Timout" error.


texts: Show price for out of stock products in recently viewed products in Magento 2

texts:
In recently viewed products, the price is not showing for Out of Stock products.

I have to show Out Of Stock products as client requirement.


texts:
Can I ask how to increase the number of values that are allowed in the Manufacturer attribute?
We have a store that has well over 250 different brands, which seems to be the limit.

We are using MCE 2.1.2
Seems an odd one, and imagine that many stores have over 250 brands.


texts: Magento 2.2.3 - Problem connecting via REST API (Shipworks)

texts:
I have been having difficulty trying to setup my Magento 2 store to work with a 3rd party shipping application that communicates with the Magento store via the REST API connection.

The system is able to get the admin token, but then cannot pull the orders from the system.

I have manually tried to get a token for both admin and customer users, which works, but I cannot use the token to then get any other data, which seems to confirm this is an authorization problem.

When I try to pull data for either, it gives a 401 unauthorized fail saying "Consumer is not authorized to access %resources"

Here is my admin token request:

POST /rest/V1/integration/admin/token HTTP/1.1
Authorization: Bearer rows3g6cturlsooeko3tyka8am5xmxsc
Content-Length: 53
Host: www.deep6gear.com
Content-Type: application/json

{
  "username":"admin_user",
  "password":"REMOVED"
}

I get a token response, for example:
"po7eshsnocy9srxa3xe48dmg98v"

But when i then structure a GET request such as this:

GET /rest/V1/orders HTTP/1.1
Authorization: Bearer po7eshsnocy9srxa3xe48dmg98v
Host: www.deep6gear.com

I get the following response back:

{
"message": "Consumer is not authorized to access %resources",
"parameters":{
"resources": "Magento_Sales::sales"
},
"trace": "#0 /home/deepsix/public_html/app/code/Magestore/Webpos/Controller/Rest.php(30): Magento\\Webapi\\Controller\\Rest->checkPermissions()\n#1 /home/deepsix/public_html/vendor/magento/module-webapi/Controller/Rest.php(357): Magestore\\Webpos\\Controller\\Rest->checkPermissions()\n#2 /home/deepsix/public_html/app/code/Magestore/Webpos/Controller/Rest.php(91): Magento\\Webapi\\Controller\\Rest->validateRequest()\n#3 /home/deepsix/public_html/vendor/magento/module-webapi/Controller/Rest.php(239): Magestore\\Webpos\\Controller\\Rest->processApiRequest()\n#4 /home/deepsix/public_html/vendor/magento/framework/Interception/Interceptor.php(58): Magento\\Webapi\\Controller\\Rest->dispatch(Object(Magento\\Framework\\App\\Request\\Http))\n#5 /home/deepsix/public_html/vendor/magento/framework/Interception/Interceptor.php(138): Magestore\\Webpos\\Controller\\Rest\\Interceptor->___callParent('dispatch', Array)\n#6 /home/deepsix/public_html/vendor/magento/framework/Interception/Interceptor.php(153): Magestore\\Webpos\\Controller\\Rest\\Interceptor->Magento\\Framework\\Interception\\{closure}(Object(Magento\\Framework\\App\\Request\\Http))\n#7 /home/deepsix/public_html/generated/code/Magestore/Webpos/Controller/Rest/Interceptor.php(65): Magestore\\Webpos\\Controller\\Rest\\Interceptor->___callPlugins('dispatch', Array, Array)\n#8 /home/deepsix/public_html/vendor/magento/framework/App/Http.php(135): Magestore\\Webpos\\Controller\\Rest\\Interceptor->dispatch(Object(Magento\\Framework\\App\\Request\\Http))\n#9 /home/deepsix/public_html/generated/code/Magento/Framework/App/Http/Interceptor.php(24): Magento\\Framework\\App\\Http->launch()\n#10 /home/deepsix/public_html/vendor/magento/framework/App/Bootstrap.php(256): Magento\\Framework\\App\\Http\\Interceptor->launch()\n#11 /home/deepsix/public_html/index.php(39): Magento\\Framework\\App\\Bootstrap->run(Object(Magento\\Framework\\App\\Http\\Interceptor))\n#12 {main}"
}

Any help on this subject would be greatly appreciated, I have hit a wall here.


texts: Recently Some of my invoice found in my admin panel not showing a proper page, just like showing Plain text page, how do I trouble shoot what's wrong with the invoice? just randomly happen


texts: How can I override default CSS properties in my theme?

texts:
I've already created a custom.css file which include some properties that I use in my custom theme (inherits from Blank theme).
I can apply successfully those custom properties, however some properties dont apply since they interfere with the default CSS properties in Blank theme.

For example:

.font { red; } - styles.css (default CSS magento file)

.font { blue; } - custom.css (my own CSS file)

The font appears red instead of blue. What should I do to override property values from the default CSS magento files?


texts: Getting Error magento product upload using dataflow profile import process

texts:
I am uploading products using dataflow profile import process.

but it is not working and I am getting errors.

screenshot :


texts:
Is there any API in magento to get list of all coupons appreciable to a corresponding cart id.

can we get sale rules for a cart id and then find coupon through it


texts: Add new column in product table while placing order from backend

texts:
I want to add a custom column in the product table that is displayed while placing order from magento admin panel .

A help will be appreciated


texts: Magento2.3.1 issue with payment via authorized.net

texts:
I have configured the authorized.net using production details (which are completely working fine on one if my magento2 store).
I am using the same card for payment test that I have used on my another Magento2 store.

Now when I entered the card details and click on place order it shows me the error message :

  {"message":"Invalid gateway credentials.", "trace":"#0
  /var/www/html/vendor/magento/framework/Interception/Interceptor.php(58):
  Magento\Checkout\Model\PaymentInformationManagement->savePaymentInformationAndPlaceOrder(453,
  Object(Magento\Quote\Model\Quote\Payment\Interceptor),
  Object(Magento\Quote\Model\Quote\Address))\n#1
  /var/www/html/vendor/magento/framework/Interception/Interceptor.php(138):
  Magento\Checkout\Model\PaymentInformationManagement\Interceptor->___callParent('savePaymentInfo...',
  Array)\n#2
  /var/www/html/vendor/magento/framework/Interception/Interceptor.php(153):
  Magento\Checkout\Model\PaymentInformationManagement\Interceptor->Magento\Framework\Interception\{closure}(453,
  Object(Magento\Quote\Model\Quote\Payment\Interceptor),
  Object(Magento\Quote\Model\Quote\Address))\n#3
  /var/www/html//generated/code/Magento/Checkout/Model/PaymentInformationManagement/Interceptor.php(26):
  Magento\Checkout\Model\PaymentInformationManagement\Interceptor->___callPlugins('savePaymentInfo...',
  Array, Array)\n#4 [internal function]:
  Magento\Checkout\Model\PaymentInformationManagement\Interceptor->savePaymentInformationAndPlaceOrder(453,
  Object(Magento\Quote\Model\Quote\Payment\Interceptor),
  Object(Magento\Quote\Model\Quote\Address))\n#5
  /var/www/html/vendor/magento/module-webapi/Controller/Rest/SynchronousRequestProcessor.php(95):
  call_user_func_array(Array, Array)\n#6
  /var/www/html/vendor/magento/module-webapi/Controller/Rest.php(188):
  Magento\Webapi\Controller\Rest\SynchronousRequestProcessor->process(Object(Magento\Framework\Webapi\Rest\Request\Proxy))\n#7 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(58):
  Magento\Webapi\Controller\Rest->dispatch(Object(Magento\Framework\App\Request\Http))\n#8
  /var/www/html/vendor/magento/framework/Interception/Interceptor.php(138):
  Magento\Webapi\Controller\Rest\Interceptor->___callParent('dispatch',
  Array)\n#9
  /var/www/html/vendor/magento/framework/Interception/Interceptor.php(153):
  Magento\Webapi\Controller\Rest\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http))\n#10
  /var/www/html/generated/code/Magento/Webapi/Controller/Rest/Interceptor.php(26):
  Magento\Webapi\Controller\Rest\Interceptor->___callPlugins('dispatch',
  Array, Array)\n#11
  /var/www/html/vendor/magento/framework/App/Http.php(136):
  Magento\Webapi\Controller\Rest\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))\n#12
  /var/www/html/vendor/magento/framework/App/Bootstrap.php(258):
  Magento\Framework\App\Http->launch()\n#13
  /var/www/html/index.php(39):
  Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http\Interceptor))\n#14
  {main}"}

Console: https://mytestweb.com/magento/rest/default/V1/carts/mine/payment-information (Where I got this response).


texts: How to set the date of a review programatically

texts:
I am trying to import some reviews programatically.  I am using the following code:

$review = Mage::getModel('review/review');
$review->setEntityPkValue($product->getId());
$review->setStatusId(1);
$review->setTitle("title");
$review->setDetail("detail");
$review->setEntityId(1);
$review->setStoreId(Mage::app()->getStore()->getId());
$review->setStatusId(1);
$review->setCustomerId(NULL);
$review->setNickname("nickname");
$review->setReviewId($review->getId());
$review->setStores(array(Mage::app()->getStore()->getId()));
$review->setCreatedAt(Mage::getModel('core/date')->gmtTimestamp($date));
$review->save();
$review->aggregate();

$date is a timestamp of the date of the review.
The problem is that my reviews are being imported at the current date.  How can I set the created_at parameter?


texts: Magento 2 Custom Module admin form category tree

texts:
How to get Magento 2 category tree  in Custom Module admin form.

I din't use UI Component I am using Main.php

like this i am adding

$fieldset->addField(
            'label',
            'text',
            [
                'name' => 'name',
                'label' => __('name'),
                'title' => __('name'),
                'note' => __('name'),
                'required' => true
            ]
        );

here how to add like this


texts: Include custom template file in catalog listing page in magento 2.3.1

texts:
I am using Magento 2.3.1, I wanted to include the custom template in product listing page for all products just above the add to cart button as shown in the attachment.

Below is my code I tried.

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceContainer name="product_list">
            <block class="Magento\Framework\View\Element\Template" name="yousave" template="MyVendor_MyModule::yousave.phtml" after="additional" />
        </referenceContainer>
    </body>
</page>

and template is

<?php echo 'hello world'; ?>

but I am not getting proper output


texts: after changing product image programatically, old image remains in catalog view

texts:
after changing main product image to custom proramatically,

            Mage::getSingleton('catalog/product_action')->updateAttributes(array($this->_product_id),
                                     array('image'=>$value['file']), 0);

still on catalog view old image remains (in the product view everything is OK), how to fix it ?
thanks !

ps
caching is disabled


texts:
Create an observer file using this event.

  sales_order_item_cancel

public function execute(EventObserver $observer)
    {
        /** @var \Magento\Sales\Model\Order\Item $item */
        $item = $observer->getEvent()->getItem();
        $children = $item->getChildrenItems();
        echo $qty = $item->getQtyOrdered() - max($item->getQtyShipped(), $item->getQtyInvoiced()) - $item->getQtyCanceled();
        exit;
        if ($item->getId() && $item->getProductId() && empty($children) && $qty) {
            $this->flag = "cancel";
            $this->cancelOrder = $item->getOrder()->getIncrementId();
            $this->stockManagement->backItemQty($item->getProductId(), $qty, $item->getStore()->getWebsiteId());
        }
        $this->priceIndexer->reindexRow($item->getProductId());
        return $this;
    }

How to get $this->flag and $this->cancelOrder values in observer file using this event.

  cataloginventory_stock_item_save_after

if($this->flag == "cancel")
{
    $orderId = $this->cancelOrder;
}


texts: Allow Multiple Boxes for shipping 1 product

texts:
In our Magento store we have some products which weigh more than 150lbs. For such product FedExs shipping is not available on checkout page as FedEx does not allow weight more than 150 lbs for single box. If I reduce weight to below 150, FedEx appears in the shipping methods.

These products can be shipped in Multiple boxes so I set  Allow Multiple Boxes for Shipping to Yes for those products under Advance Inventory pop up.

Still FedEx is not calculating shipping price for these products. How can I allow multiple box shipping for these products For FedEx Shipping?


texts:
I recently applied the latest security patches on the website which went successful. But after the patches, we found that we are not able to capture the funds now. We can authorize the payment, but when clicking on capture in Invoice it gives "Gateway error: Credit card is required". I cross-checked the log response with our earlier successful captures and found that x_type in the request was going as prior_auth_capture whereas now it's going as auth_capture. I think this is the reason of fail, how to send the request to capture as prior_auth_capture?

Any ideas what could be wrong. Note that we have not changed any config settings or anything, just applied last few patches that's it.


texts: How to Render Blocks of different sizes on desktop and Mobile

texts:
Please refer this url:
https://www.unnatisilks.com/

These guys are rendering one sets of Home page blocks on desktop and the same images with 2 row alignment on mobile

How can I achieve this?

I also want to know how to get blocks per row with complete width on mobile just like this page:
https://www.unnatisilks.com/sarees-online.html

Please help
I see that this site is built on Magento
So is their a custom plugin which can help?


texts: Product view page not open when customer log out in magento 2.3?

texts:
I have a site in Magento 2.3!

My requirement is when the customer does not log in to my site so he can not see product view page.

they see only the product listing page.

and when he click product so redirect the customer login page.

So please help me asap!

Thanks.


texts: Send transictional email of backend programmatically in Magento 2

texts:
I'm trying to send programmatically transitional emails that I created in the backend.
I did some research and saw many examples of sending emails programmatically only for those in html format.
How can I send my emails created in the backend programmatically?
Thank you


texts:
I have a customer Magento 2 website, created, i don't know by composer command or with web wizard method, in the root folder, there's a git folder,
I would like to apply those commits https://github.com/magento/magento2/issues/20277#issuecomment-458397222 to the Magento 2.2.4, the commits are in the 2.3.1 version
Is there a way to do it programmatically?


texts: How to rename Order Total in Order Summary Sidebar?

texts:
I just tried with vendor folder -

 vendor\magento\module-checkout\view\frontend\layout\checkout_cart_index.xml

line no 163 - I renamed the title.

But it is not reflecting.


texts:
Running the very basic SOAP request to list all services:

soap/default?wsdl_list=1

I get

The "\DateTime" parameter type is invalid. Verify the parameter and try again.


texts: Change the links in a custom third party theme

texts:
I have to change the text "Prijava" in the header to "Login". See the image:

How can I do this? I tried to look for it in the .phtml and Block class, but I couldn't find the text "Prijava" nowhere, in order to change it. Where can it be? I tried also to look at the CMS tab Static Blocks and Pages section in admin, but this text doesn't exist there either.


texts:
In the admin there are three options for debugging your theme layout:

Enabled Template Path Hints for Storefront
Enabled Template Path
Hints for Admin Add Block Names to Hints

When at least the first one is enabled, you get red rectangles highlighting where a template file starts and ends.

These correspond to all places a block class is mentioned in the layout XML file. If the 3rd option is selected you also see the name of the block class.

Question:

Is it possible to output the container name(s) wrapping the blocks?


texts:
I'm doing some page speed optimization and it says that I should preload some icons.

I've got this command but I can't find where to add it, they say that It should be added to the <head> but I'm not sure where. I tried adding it to my default_head_blocks.xml but it broke the site:
<link rel="preload" href="font.woff2" as="font" type="font/woff2" crossorigin>

I've been following this but they don't tell where to add it.

https://stackoverflow.com/questions/49674092/preloading-font-with-rel-preload
https://www.smashingmagazine.com/2016/02/preload-what-is-it-good-for/#early-loading-of-fonts


texts: Magento 2 - Images gone after swapping Theme to custom theme

texts:
I've installed Magento 2 with Data and it all installed well and all data and images where there.

I then created a theme based on Luma and as soon as I activated the new theme all the images have disappeared.

How can I bring the images back?


texts: How to generate the links from layered navigation but only for a specific product on the product page - magento

texts:
I have specific product - "Toyota Corolla Headlight"

It has 4 multiselect attributes and they are presented in layered navigation:

year: with values - 1999,2000
model: with value - Corolla
make: with value - Toyota
type: with values - Headlight, Fog Lights, Headlight Bulb

It possible to display it as links on product page?

Example

Toyota Corolla 1999 Headlight

Toyota Corolla 1999 Fog Lights

Toyota Corolla 1999 Headlight Bulb

The basic idea - get links from layered navigation but only for the specific product.

I could not find such a solution.

I understand that it is difficult - but maybe i can start to get the values of specific product attributes as links.

Please help!

FIRST UPDATE

$attributes = Mage::helper('amshopby/attributes')->getFilterableAttributes();
foreach ($attributes as $attribute) {
    if ($attribute->getAttributeCode() == 'year') {
        $filterBlockName = 'amshopby/catalog_layer_filter_attribute';
        $result = Mage::app()->getLayout()->createBlock($filterBlockName)->setAttributeModel($attribute)->init();
        foreach($result->getItems() as $option) {
            echo '
getUrl() . '">'.$option->getLabel().'
';

        }
    }
}

This code returns all existing values from attribute "year" with the correct links, But I need only the values of the current product.

DEBUG INFO

    var_dump($_product->getData());
    ["year"]=> string(8) "12,11"

    var_dump($result->getData());
    "year" ["attribute_id"]=> string(3) "151"

    var_dump($option->getData()); - not work

    var_dump($option->debug());
    ["label"]=> string(4) "1999" ["value"]=> string(2) "12" ["count"]=> string(1) "3" ["option_id"]=> string(2) "12"
    ["label"]=> string(4) "2000" ["value"]=> string(2) "11" ["count"]=> string(1) "2" ["option_id"]=> string(2) "11"

Next, I will think how to combine the values of each other.


texts: S3 Bucket + Microsoft Azure Blob Storage in magento 2

texts: Is any one has experience with Microsoft Azure with Magento2? Any one knows how Azure blob storage integration with Magento2. Any extension available?


texts: Magento 2: Get product ID in override getTierPriceList from TierPrice

texts:
I'm extending \Magento\Catalog\Pricing\Price\TierPrice to return a custom list of tier prices for products. But I can't seem to figure out how to get the product id that is calling the getTierPriceList method. Any suggestions?

My di.xml:

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <preference for="Magento\Catalog\Pricing\Price\TierPrice" type="MyCompany\Pricing\Model\Plugin\TierPrice" />
</config>

TierPrice class:

<?php
namespace MyCompany\Pricing\Model\Plugin;

class TierPrice extends \Magento\Catalog\Pricing\Price\TierPrice
{
    public function getTierPriceList()
    {
        //custom code goes here, return original for now.
        return parent::getTierPriceList();
    }
}


texts: SUPEE Patches Don't Support Magento versions: 1.2, 1.3, and 1.4?

texts:
I noticed that SUPEE 8788 excluded magento 1.2, 1.3 and 1.4 versions. I though Magento will support 1.x versions for the next 2-3 years.
 Why did they stop releasing SECURITY patches for 1.x lower versions?


texts: Can we use MySql enterprise edition with Magento community edition?

texts:
Does any one know that if we can use MySql enterprise edition with Magento community edition?

If yes, are there any benefits of using MySql enterprise instead of MySql community version?

Please suggest.


texts: Update the Price of an item when adding to the cart

texts:
So here's my project.
Make our giftcard integration purchasable.

Basically I need to get an "Enter Custom Amount" input field to update the price of the item.
What I have been told by our architect is that I should Update the MyCompany_GiftCard_Model_Product_Type_GiftCard class to extend Mage_Catalog_Model_Product_Type_Abstract

then override the _prepareProduct Method to use the value from the custom amount if defined. So. I made this method:

protected function _prepareProduct(Varien_Object $buyRequest, $product, $processMode) {
    $result = parent::_prepareProduct($buyRequest, $product, $processMode);
    $oRide = $buyRequest->getOverrideAmount();
    $stn_amt = $buyRequest->getAmount();
    $productGiftCard = $buyRequest->getGiftCard();

    if(isset($oRide) && ($oRide != '') && ($oRide != 0) && ($oRide != null)){
        $result[0]->addCustomOption('giftcard_amount', $oRide);
    }else{
        $result[0]->addCustomOption('giftcard_amount', $amount);
    }

    if (!empty($productGiftCard)) {
        return $result;
    }
    return Mage::helper('catalog')->__('Please specify the required options of product.');
}

Then I was told to update the getFinalPrice() method to accept the new value from MyCompany_GiftCard_Model_Product_Type_GiftCard_Price

public function getFinalPrice($qty = null, $product)
{
    $finalPrice = parent::getFinalPrice($qty, $product);
    $amount = $product->getCustomOption('giftcard_amount'); // its an object or false
    if($amount) {
        $finalPrice = $qty * $amount->getValue();
    }
    // echo '<br>finalPrice: '.$finalPrice;
    $product->setFinalPrice($finalPrice);
    // echo $product->getData('final_price');
    // Mage_Sales_Model_Quote_Item_Abstract

    return max(0, $product->getData('final_price'));
}

Here's the thing.
If you do: echo $product->getData('final_price'));
It totally equals the price I want to be! If the custom amount is set, final_price == custom amount!

Does anyone have any ideas where I'm going wrong and why the GetFinalPrice is not the price for the item in checkout?

(I'm rather new to Magento, 3 months-ish, but our architect was quite adamant that updating the getFinalPrice() method directly update the price in the cart! He's unavailable right now, and I have a deadline.


texts: How do I integrate Braintree with Magento 1.9.3?

texts: Whic is the best way to integrate Braintree with Magento 1.9.3?


texts: Magento 2 Authorize.net DirectPost authorize programmatically

texts:
I need to take information entered into a quote object, and authorize it on DirectPost programmatically.

The code, just like the REST API, will create an order, but with no payment data and no transaction.  Nothing gets sent to Authorize.net.

This is what I have that creates an order from a quote with the correct payment method, but no transaction and no authorization:

    $cartId = $post['cart_id'];

    $quote = $this->_objectManager->create('\Magento\Quote\Model\Quote')->loadActive($cartId);
    $info = $quote->getPayment()->importData(
        [
            PaymentInterface::KEY_METHOD => 'authorizenet_directpost',
            'cc_type' => $post['cc_type'],
            'cc_owner' => $post['cc_owner'],
            'cc_last_4' => substr($post['cc_number'], -4),
            'cc_number' => $post['cc_number'],
            'cc_cid' => $post['cc_cid'],
            'cc_exp_month' => $post['cc_exp_month'],
            'cc_exp_year' => $post['cc_exp_year']
        ]
    );
    $quote->setCustomerId(null);
        $quote->setCustomerEmail($quote->getBillingAddress()->getEmail());
        $quote->setCustomerIsGuest(true);
        $quote->setCustomerGroupId(\Magento\Customer\Api\Data\GroupInterface::NOT_LOGGED_IN_ID);

        $billingaddress=$quote->getBillingAddress();
        $quote->getShippingAddress()->setSameAsBilling(true);
        $quote->save();
    $payment = $quote->getPayment();
    $order = $this->_objectManager->create('\Magento\Quote\Model\QuoteManagement')->submit($quote);

How do I get it to authorize and add transaction data to the order it created?


texts: When importing products via csv I get: Entity adapter object must be an instance of Mage_ImportExport_Model_Import_Entity_Abstract

texts:
I was having trouble with Magento assigning the first QTY amount in the CSV to every single product and ignoring the assigned qty for that product. So, I tried this fix and now am getting the following error every time I try to import a CSV that was previously working:

Entity adapter object must be an instance of Mage_ImportExport_Model_Import_Entity_Abstract


texts: How to I show recently viewed products on magento CMS page?

texts:
Can anybody Help me with this please:

frontend/{package}/{theme}/template/reports/recent-products-view.phtml

I tried this below example but not working

{{block type="reports/product_viewed" template="reports/product_viewed.phtml"}}


texts: How to use an exclusive domain in a specific category page?

texts:
I'm using Magento 2.4 and I want to offer to my partners a page with products in a new domain and I think I can do it assigning a domain to some specific categories, instead of creating many stores.
How could I do it?


texts:
This is my code, i get random products here ...

$products = Mage::getModel('catalog/product')->getCollection();
$products->addAttributeToSelect(array('name', 'thumbnail', 'price')); //feel free to add any other attribues you need.

Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($products);
Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($products);
Mage::getModel('cataloginventory/stock_item')->loadByProduct($products);

$products->getSelect()->order('RAND()');
$products->getSelect()->limit(6);

... but this code show out of stock products too. I need just show in stock (available) products here. How can i do that?


texts:
Can you please tell me that which tables are containing junk data??

My webstore database is increasing daily. So i want to reduce my database size.


texts: Magento 2 - Set Tracking Info for Order via REST API without specifying items?

texts: Is it possible to add in shipping and tracking information for an order using the Magento 2 REST API without putting in the item information. We always ship the entire order and based on our warehouse setup, it's very difficult to specify the items. Any help is greatly appreciated.


texts:
I am trying to get Order detail on success page by making a custom module and in my block file code is

/**
 * @var \Magento\Checkout\Model\Session
 */
protected $checkoutSession;

/**
 * @var int
 */
protected $oderId;

/**
 * @var array
 */
protected $lastOrder;

/**
 * @param \Magento\Framework\View\Element\Template\Context $context
 * @param \Magento\Checkout\Model\Session $checkoutSession
 * @param array $data
 */
public function __construct(
    \Magento\Framework\View\Element\Template\Context $context,
    \Magento\Checkout\Model\Session $checkoutSession,
    \Magento\Sales\Model\OrderFactory $orderFactory,
    array $data = []
) {
    parent::__construct($context, $data);
    $this->checkoutSession = $checkoutSession;
    $this->_orderFactory = $orderFactory;
}

protected function _prepareLayout()
{
    $lastOrder = $this->checkoutSession->getLastRealOrder();
    $this->orderId = $lastOrder->getIncrementId();
    $this->lastOrder = $lastOrder->getData();
    return parent::_prepareLayout();
}

public function getOrderId()
{
    return $this->orderId;
}

public function getSubtotal()
{
    /** @var \Magento\Sales\Model\Order $order */
    $order = $this->_orderFactory->create()->load($this->orderId);
    return $order->getSubtotal();
}

public function getDiscountAmount()
{
    /** @var \Magento\Sales\Model\Order $order */
    $order = $this->_orderFactory->create()->load($this->orderId);
    return $order->getDiscountAmount();
}

But after place order and on success page getting error

  Uncaught TypeError: Argument 3 passed to CompanyName\Modulename\Block\successpagedata::__construct() must be an instance of Magento\Sales\Model\OrderFactory, array given, called in /vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php on line 93

I checked code many times but not getting any issue.Can anybody let me know what I am doing wrong.Please help me.


texts: How do I fix my Base URLs so I can access my Magento site?

texts:
I changed Base Urls and now my website is inaccessible
I moved everything to a new server, didn't change the base_url and my website is inaccessible

How do I change or restore base_url my BaseURL settings?


texts: How to modify a label to a field in checkout page?

texts:
I need to edit a label in a field in the checkout page.

I should have an extension (Firecheckout) to manage checkout page.

In fact, the checkout page has an url like domainname.com/firecheckout

In user manual (http://templates-master.com/firecheckout-user-manual#Different%20layout%20type) you can see that you can easily change a label

But in my platform those field checkout fields are not filled in "checkout fields" menu, nor in standard configuration view, nor in main website view

How could I change a label?


texts: Upgraded Magento and now Admin page is blank

texts:
I've just updated our store as it hadn't been done in a while through Magento Connect.

Now when I try to access the admin area (http://www.example.com/index.php/admin) it just returns a white page.

Any advice would be much appreciated.

I believe it's Magento 1.9 but I'm not 100% sure.


texts: Paypal - Overriding Payflowpro.php file is not working

texts:
There is an official bug in Magento 2.2.3 of Paypal Payflow Pro, It is sending comment_1 parameter to Paypal instead of comment1, And Paypal is ignoring this parameter

Magento Team acknowledge this issue: (https://github.com/magento/magento2/issues/15163 )

Now to fix it, I am trying to override \Magento\Paypal\Model\Payflowpro model file

But it's not working, I compiled, upgraded, flush, removed all cached from var/generated folder

But It's not working. Do you have any clue why it's not working?

This is my code

  module.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
    <module name="MyNameSpace_Paypal" setup_version="1.0.1">
        <sequence>
            <module name="Magento_Paypal" />
        </sequence>
    </module>
</config>

  Payflowpro.php

<?php
namespace MyNameSpace\Paypal\Model;

use Magento\Framework\DataObject;
use Magento\Sales\Model\Order;

class Payflowpro extends \Magento\Paypal\Model\Payflowpro
{
    public function addRequestOrderInfo(DataObject $request, Order $order)
    {
        $id = $order->getId();
        //for auth request order id is not exists yet
        if (!empty($id)) {
            $request->setPonum($id);
        }
        $orderIncrementId = $order->getIncrementId();

        //Added ->setData('comment1', $orderIncrementId);
        //instead of ->setComment1($orderIncrementId)

        $request->setCustref($orderIncrementId)
            ->setInvnum($orderIncrementId)
            ->setData('comment1', $orderIncrementId);
    }
}

  di.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <preference for="Magento\Paypal\Model\Payflowpro" type="MyNameSpace\Paypal\Model\Payflowpro" />
</config>


texts: Cant't edit products in Magento 1.9.2. Need help?

texts:
The store had been running fine until when i installed a sizechart extension from Magento Connect. The extension failed to work properly so i deleted it manually from my installation via FTP. But afterwards the deletion I am unable to edit any of my products. Just when i click to edit the following error comes up:
There has been an error processing your request

   Source model "sizechart/attribute_source_module" not found for attribute "sizechart"

Trace:
#0 /home/sialspor/public_html/app/code/core/Mage/Eav/Model/Entity/Attribute/Abstract.php(387): Mage::exception('Mage_Eav', 'Source model "s...')
#1 /home/sialspor/public_html/app/code/core/Mage/Adminhtml/Block/Widget/Form.php(201): Mage_Eav_Model_Entity_Attribute_Abstract->getSource()
#2 /home/sialspor/public_html/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Attributes.php(70): Mage_Adminhtml_Block_Widget_Form->_setFieldset(Array, Object(Varien_Data_Form_Element_Fieldset), Array)
#3 /home/sialspor/public_html/app/code/core/Mage/Adminhtml/Block/Widget/Form.php(144): Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Attributes->_prepareForm()
#4 /home/sialspor/public_html/app/code/core/Mage/Core/Block/Abstract.php(918): Mage_Adminhtml_Block_Widget_Form->_beforeToHtml()
#5 /home/sialspor/public_html/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tabs.php(79): Mage_Core_Block_Abstract->toHtml()
#6 /home/sialspor/public_html/app/code/core/Mage/Core/Block/Abstract.php(293): Mage_Adminhtml_Block_Catalog_Product_Edit_Tabs->_prepareLayout()
#7 /home/sialspor/public_html/app/code/core/Mage/Core/Model/Layout.php(456): Mage_Core_Block_Abstract->setLayout(Object(Mage_Core_Model_Layout))
#8 /home/sialspor/public_html/app/code/core/Mage/Core/Model/Layout.php(472): Mage_Core_Model_Layout->createBlock('adminhtml/catal...', 'product_tabs')
#9 /home/sialspor/public_html/app/code/core/Mage/Core/Model/Layout.php(239): Mage_Core_Model_Layout->addBlock('adminhtml/catal...', 'product_tabs')
#10 /home/sialspor/public_html/app/code/core/Mage/Core/Model/Layout.php(205): Mage_Core_Model_Layout->_generateBlock(Object(Mage_Core_Model_Layout_Element), Object(Mage_Core_Model_Layout_Element))
#11 /home/sialspor/public_html/app/code/core/Mage/Core/Model/Layout.php(210): Mage_Core_Model_Layout->generateBlocks(Object(Mage_Core_Model_Layout_Element))
#12 /home/sialspor/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(344): Mage_Core_Model_Layout->generateBlocks()
#13 /home/sialspor/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(269): Mage_Core_Controller_Varien_Action->generateLayoutBlocks()
#14 /home/sialspor/public_html/app/code/core/Mage/Adminhtml/Controller/Action.php(275): Mage_Core_Controller_Varien_Action->loadLayout(Array, true, true)
#15 /home/sialspor/public_html/app/code/core/Mage/Adminhtml/controllers/Catalog/ProductController.php(250): Mage_Adminhtml_Controller_Action->loadLayout(Array)
#16 /home/sialspor/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Adminhtml_Catalog_ProductController->editAction()
#17 /home/sialspor/public_html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('edit')
#18 /home/sialspor/public_html/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#19 /home/sialspor/public_html/app/code/core/Mage/Core/Model/App.php(365): Mage_Core_Controller_Varien_Front->dispatch()
#20 /home/sialspor/public_html/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#21 /home/sialspor/public_html/index.php(83): Mage::run('', 'store')
#22 {main}


texts:
I am trying to filter the collection based on contain string

It is working

$collection = $this->_chennaidbFactory->create()->getCollection()
            ->addFilter('event_date',['like'=>'2016-05-21 16:00:00'])
            ->setOrder('event_date', 'DESC');

It is not working, ($datepicker carry yyyy-mm-dd)

$collection = $this->_chennaidbFactory->create()->getCollection()
            ->addFilter('event_date',['like'=>'%'.$datepicker.'%'])
            ->setOrder('event_date', 'DESC');

also tried like many way

addFilter('event_date',['like'=>'%2016-05-21%'])
addFilter('event_date',['like'=>'2016-05-21%'])


texts: Customize the number of sliding images in the product detail page on magento 2

texts:
I want my library to contain a maximum of 3 images on the screen and 100% width.
Can someone help me?


texts: Want to display label or respected value on the visual swatch attribute at Layered navigation?

texts:
I have created size attribute with visual swatch field now in the fronted when we hover at option it is displaying the value/s for the users. Instead of changing to text swatch how to display the label (or) respected value on that size attribute in the layered navigation.

Please refer the below screenshot so that will get some idea.

could you please suggest.


texts: configuration settings not display in admin after upgrade 2.2.1

texts:
After upgrading Magento from 2.1.8 to 2.2.1 in admin section some of tab blank.

If I comment below line from system.xml then it show again but no data save in database.

<!--<backend_model>Magento\Config\Model\Config\Backend\Serialized</backend_model> -->


texts:
I faced with issue during Magento updating from Magento EE 1.12.0.2 to EE 1.13.x.
After running script php -f shell/url_migration_to_1_13.php all of my product URL's were changed from <product-url> to <product-url>-1. And weird rewrite rules were added for old URL (check the following image)


texts: I want use magento2 default contact form in my static block

texts:
Hi I am trying to use Default contact form in my static block or custom cms page. for that I am using this code. but not getting any result.

{{block class="Magento\Framework\View\Element\Template" name="contactForm" form_action="/contacts/index/post" template="contacts/form.phtml"}}


texts: unable to get out of stock configurable products in configurable product collection in Magento 2

texts: I'm trying to get all Magento 2 configurable product collection, but here i'm unable to get out of stock configurable products in my configurable product collection


texts: Attention: Something went wrong, Error when applying filter

texts:
I added an attribute in sales_order, and display it as a column in sales_order_grid, all is set but when I try to apply filter on my custom column it gives me an error with a pop-up like: Attention: Something went wrong, Yes! I also get some errors in console and in network please see below images:

Here Is my code:
app/code/EC/SampleModule/view/adminhtml/ui_component/sales_order_grid.xml

<?xml version="1.0" encoding="UTF-8"?>
<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
    <columns name="sales_order_columns">
        <column name="sample_status" class="EC\SampleModule\Ui\Component\Listing\Column\Status">
            <argument name="data" xsi:type="array">
                <item name="options" xsi:type="object">EC\SampleModule\Model\Source\printStatus</item>
                <item name="config" xsi:type="array">
                    <item name="filter" xsi:type="string">select</item>
                    <item name="bodyTmpl" xsi:type="string">ui/grid/cells/html</item>
                    <item name="dataType" xsi:type="string">select</item>
                    <item name="component" xsi:type="string">Magento_Ui/js/grid/columns/select</item>
                    <item name="label" xsi:type="string" translate="true">Sample Status</item>
                </item>
            </argument>
        </column>
    </columns>
</listing>

app/code/EC/SampleModule/Model/Source/printStatus.php

<?php

namespace EC\SampleModule\Model\Source;

class printStatus implements \Magento\Framework\Option\ArrayInterface
{
    /**
     * @return array
     */
    public function toOptionArray()
    {
        $options = [
            [
                'value' => 0,
                'label' => __('No')
            ],
            [
                'value' => 1,
                'label' => __('Yes')
            ]
        ];

        return $options;
    }
}

app/code/EC/SampleModule/Ui/Component/Listing/Column/Status

<?php

namespace EC\SampleModule\Ui\Component\Listing\Column;

use \Magento\Sales\Api\OrderRepositoryInterface;
use \Magento\Framework\View\Element\UiComponent\ContextInterface;
use \Magento\Framework\View\Element\UiComponentFactory;
use \Magento\Ui\Component\Listing\Columns\Column;
use \Magento\Framework\Api\SearchCriteriaBuilder;
use \Magento\Framework\App\ResourceConnection;

class Status extends Column
{
    protected $_orderRepository;
    protected $_searchCriteria;
    protected $_resourceConnection;

    public function __construct(
        ContextInterface $context,
        UiComponentFactory $uiComponentFactory,
        OrderRepositoryInterface $orderRepository,
        SearchCriteriaBuilder $criteria,
        ResourceConnection  $resourceConnection,
        array $components = [],
        array $data = [])
    {
        $this->_orderRepository = $orderRepository;
        $this->_searchCriteria  = $criteria;
        $this->_resourceConnection = $resourceConnection;
        parent::__construct($context, $uiComponentFactory, $components, $data);
    }

    public function prepareDataSource(array $dataSource)
    {
        if (isset($dataSource['data']['items'])) {
            foreach ($dataSource['data']['items'] as & $item) {
                $order = $this->_orderRepository->get($item['entity_id']);
                $sampleStatus = $order->getSampleStatus();
                $item['sample_status'] = $sampleStatus;
            }
        }

        return $dataSource;
    }
}


texts: Magento 2 ECE : how to access root privileges

texts:
I just need to edit some .cnf file in cloud server.
but in documentation they are write : you can access this file As a user with root privileges
how can i use root privileges in server.

any idea please share


texts: Swatcher PNG trancparency doesn't work and makes background black (Magento 2)

texts: Transparent part of my PNG Files get black on color swatcher images. In product photos it seems to work fine. Anyone know how to fix that?


texts: Multistore (languages) on one and the same domain (no subdirectories or subdomains)

texts:
we have several stores. All with several languages. Now I was wondering why we dont just serve all these stores using 1 domain? (no storecode, no subdirectory)

Question: Why would this not be an idea?

Suppose one could add the href lang tag. Based on the accept language customers are sent to the relevant store (using __store variable in URL/that we hide using apache)
href lang tag

The options for a multistore are as follows

Add storecode to URL The most basic option is to be found under System > Configuration > Web called the option Add storecode to url. The drawback is however that this will also affect the existing stores adding the storecode to that one's urls as well (but there is an extension to circumvent this for default store)
hide default store code

Create a subdirectory You will need to create a subdirectory in your Magento installations root called /storename and copy the index.php in there. Also create symlinks for the media, js and skins directory and add an .htaccess (you can copy that one from the root, if you use apache)

Work with subdomains In this case that would be newstore.domain.com. Just add this to you apache config and set the new storeviews base domain to that URL

New! Stay on the same domain. In this case you just set-up the new store. Don't change the store URL's. The language dropdown appears. In this you should use a multilanguage sitemap + href lang tags.


texts:
i want to add a page in menu. How can i create it?

Please help me!


texts: how to update email template from backend for custom module in magento 2

texts: My custom module file is showing in the drop down (marketing -> email template) but when i add and update the code it is not showing up in email


texts: What are cons to accessing magento database directly to pull out product data

texts:
I am working on a custom app where customers will be able to virtually try on and potentially even buy my products via an iphone/android app.

I am currently working on mastering using the Magento2 API to pull in product information needed in the app.

However I am wondering what is the cons of just having my app connect to the Magento database directly to pull needed product information vs using the app?

are there benefits of using the magento app over directly querying the database assuming I know what tables and how to write the needed quires to pull all product data out of the magento database?


texts:
I'm working on a module which will modify the URLs for our category pages using a Magento 2 preference. I've created a module which looks correct, but on most pages the url is unchanged and on product pages it refuses to load, with apache reporting the error:

PHP Fatal error:  Class 'Company\\CategoryUrls\\Model\\Category' not found in [root folder]/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php on line 93

As far as I can see the module should be correct, and I know the change in behaviour works as I've tried editing it directly into the file in the vendors folder,but I just can't seem to get it to work. If anyone's got any suggestions it'd be appreciated

Module File:

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Company_CategoryUrls" setup_version="1.0.0" ></module>
</config>

DI file:

<?xml version="1.0" ?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<preference for="Magento\Catalog\Model\Category" type="Company\CategoryUrls\Model\Category"/>
</config>

Class:

<?php

namespace Company\CategoryUrls\Model;
use \Magento\Catalog\Model\Category;

class CategoryUrl extends Category{
/**
 * Get category url
 *
 * @return string
 */
public function getUrl()
{
[contents of parent class]
}
}


texts: magento2 You cannot define a correlation name 'tdv' more than once

texts:
I want to load product. But it error You cannot define a correlation name 'tdv' more than once. If i load 1 product it working (setPageSize(1)). But when load more than 1 it error
This is my code file php
public function getLoadProduct()
{
    $productModel = $this->_productloader->create()->addAttributeToSelect('*');
    $productModel->setPageSize(1)->setCurPage(1)->load();
    return $productModel;
}
public function getOptionValue($optionId){
    if(isset($optionId)){
        $optionValue = $optionId;
        $optionFactory = $this->optionFactory->create();
        $optionFactory->load($optionValue);
        $attributeId = $optionFactory->getAttributeId();
        $optionData = $this->_attributeOptionCollection
                        ->setPositionOrder('asc')
                        ->setAttributeFilter($attributeId)
                        ->setIdFilter($optionValue)
                        ->setStoreFilter()
                        ->load();
        return $optionData->getData()[0]['value'];
    }
    return "";
}

This is my code file phtml
 <?php $product = $this->getLoadProduct(); ?>
 <?php foreach($product as $item) : ?>
        <?php $val = $this->getOptionValue($item->getCommercersSelect()); ?>

            <?php $image = $this->resize($item->getThumbnail(),240,300); ?>
            <?php echo '';  ?>

<?php echo $item->getName(); ?>

<?php echo $item->getPrice(); ?>

<?php echo $item->getCommercersTraining(); ?>

<?php echo $val; ?>

    <?php endforeach ?>

Please help me!


texts: Magento 1 session in database error with PHP 7.2

texts:
Updated to Magento 1.9.3.10 with PHP 7.2. If I save the sessions in db:

<session_save><![CDATA[db]]></session_save>

I get this error:

Recoverable Error: session_module_name(): Cannot set 'user' save handler by ini_set() or session_module_name()  in /var/www/html/app/code/core/Mage/Core/Model/Session/Abstract/Varien.php on line 83


texts: How to translate i18n value from tag in html?

texts:
I want to Translate a custom button name using i18n. I tried like this

  app/code/My_vendor/My_module/i18n/ar_SA.csv

"I am the gift Receiver","أنا المتلقي هدية"

The affect should take place in below html file

  app/code/My_vendor/My_module/view/frontend/web/templates/actions.html

<button click="datafill">

</button>

Note: I also tried translate but it also didn't work for me.

Question: How to translate i18n value from tag in html.


texts: Disable Email Notfication for Inactive Company Users

texts: Is there a configuration setup to disable email being sent to inactive company users? Please point me to the right direction. Badly needed help!


texts: PHP - How to get number of all members in a customer group

texts:
I am working on a custom magento extension.

I've made a selection menu with all customer groups, here is the code of it:

$CustomerGroups = Mage::getResourceModel('customer/group_collection')->toOptionArray();

$CustomerGroups = array_merge(array('' => ''), $CustomerGroups);

$fieldset->addField('customergroups', 'select',
        array(
            'name'      => 'customergroups',
            'label'     => Mage::helper('smsnotification')->__('User Group'),
            'class'     => 'required-entry',
            'values'    => $CustomerGroups
        )
    );

Here is the result:

As you can see the results are like this:

not logged in
General
Wholesale
Retailer

What i want is simply to add the number of members in every customer group, for example General - (125 members).

Let me give you an example of what i want to achieve but don't know how in image:


texts: Add "Use Default Option" In Custom Category Attribute In Magento 2

texts: I am creating a custom category attribute. When I am changing the store view language, then Use Default Option not appearing.


texts: magento 2 add to cart observer modify price

texts:
Wel i have plugin which shows price in frontend from custom attribute.

public function afterGetPrice(\Magento\Catalog\Model\Product $product, $price) {
    if($product->getData('price_per_area')) $price = $product->getData('price_per_area');
    return $price;
}

Now i need to revert price to original price when product is added to cart, made an observer with event: checkout_cart_product_add_before

public function execute(
    \Magento\Framework\Event\Observer $observer
) {
    $item = $observer->getEvent()->getData('product');
    if($item->getData('price_per_area')){
        $item->setPrice(($item->getSpecialPrice() ? $item->getSpecialPrice() : $item->getPrice()));
    }
}

and here i have issue:
product is added to cart but the price is still the one from custom attribute, when i click on update cart button then it shows the correct price

as you can see from screenshots the price which is shown in summary is correct in both cases.

also tried my observer with checkout_cart_product_add_after result was same. tried with custom theme and luma

is it magento/template bug or there is some work around ?


texts: PayPal Payflow Pro Does Not Log All Payment Information and Also Auto Approves eCheck

texts:
We previously were using “PayPal Payments Advanced“ Magento payment method to connect our online store to our PayPal account. We have recently switched to “Payflow Pro” Magento payment method because it offers the ability to enter credit card information without leaving the checkout page before confirming their order.

There are two downfalls with Payflow Pro:

1) PayFlow Pro does not send  Seller protection, AVS, etc back to us (see before and after screenshot below)

2) When customers checkout with the eCheck option, orders come straight through as processing which in turn is sent to our ERP system as if the order is already approved/completed

BEFORE:

AFTER:

Does anyone have any advice on how to solve these two issues? We are using Magento ver. 1.9.3.9 Thanks!


texts:
config.xml:

<config>
    <modules>
       <ASD_MyhProductImporter>
        <version>0.0.1</version>
       </ASD_MyhProductImporter>
    </modules>
    <global>
        <models>
            <myproductimporter>
                <class>ASD_MyProductImporter_Model</class>
            </myproductimporter>
        </models>
        <resources>
            <myproductimporter_setup>
                <setup>
                    <module>ASD_MyProductImporter</module>
                    <class>Mage_Core_Model_Resource_Setup</class>
                </setup>
                <connection>
                    <use>core_setup</use>
                </connection>
            </myproductimporter_setup>

...

The script:

/* @var $installer Mage_Core_Model_Resource_Setup */
$installer = $this;
$installer->startSetup();

$installer->run("CREATE TABLE  'custom_options' (
'config_id' INT(10) UNSIGNED NOT NULL AUTO_INCREMENT ,
'scope' VARCHAR(8) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
'scope_id' INT(11) NOT NULL DEFAULT  '0',
'template_id' INT(3) NOT NULL ,
'value' TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
PRIMARY KEY ('config_id','scope','scope_id','template_id')
) ENGINE = INNODB;"
);

$installer->endSetup();

The myproductimporter_setup row in the core_config_data is not present.

The table that I am trying to create also does not exist.


texts: Delete order item after successfully save order Magento 2

texts:
I want to delete the order item from observer I created like this:

namespace Namespace\Module\Observer;

use Magento\Framework\Event\ObserverInterface;

class AfterOrder implements ObserverInterface
{

    protected $_objectManager;

    public function __construct(
        \Magento\Framework\ObjectManagerInterface $objectManager
    ) {
        $this->_objectManager = $objectManager;
    }

    public function execute(\Magento\Framework\Event\Observer $observer)
    {
        //not sure if it's correct
        $order = $observer->getEvent()->getOrder();
        foreach($order->getAllItems() as $item){
          if(condition){
             //delete order item, how?
          }
        }
    }
}

events.xml:

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
   <event name="checkout_onepage_controller_success_action">
       <observer name="module_controller_success_action" instance="Namespace\Module\Observer\AfterOrder"  />
   </event>
</config>


texts:
I overrided the default.phtml under module -checkout and eliminated the qty box and i did flush cache and deleted folder under static except.htaccess

But still having the qty box after refreshing the page. so can anyone please help me figure out the error and thanks in advance


texts: Magento2 - How to clear data from jQuery modal popup after closing modal?

texts:
Here am using jQuery popup in my .phtml file on the first run it sending data properly, on send time it fetching old data as-swell as new data. So how to prevent this condition.
Code:

                      <select id="reason_id" name="field1">
                        <option value="R000001">Order Created by Mistake</option>
                        <option value="R000002">Items would not arrive on time</option>
                        <option value="R000003">Shipping cost is too high</option>
                        <option value="R000004">Item price is too high</option>
                        <option value="R000005">Need to change order details or payment method</option>
                        <option value="R000006">Others</option>
                      </select>
                        <textarea class="reason_msg" name ="field2" rows="4" cols="50"></textarea>

                        <button  name="submit" id="submit">Submit</button>

<?php foreach ($_orders as $_order): ?>

    <button class="cancel_order gray-btn" value="<?php echo $_order->getId(); ?>"><?php /* @escapeNotVerified */ echo __('Cancel') ?></button>

 <?php endforeach; ?>

Here is my jQuery for modal popup:

require(['jquery', 'jquery/ui'],function($){
        // $(".popUpDiv").hide();
      $('.reason_msg').hide();
      $(".cancel_order").click(function(){
        console.log("here 1");
         var reason_msg = '';
          var order_id = $(this).val();
           console.log(order_id);

            // $(".popUpDiv").show();
             $("#reason_id").change(function(){
                if($('#reason_id').val() == 'R000006'){
                    $('.reason_msg').show();
                 }else{
                    $('.reason_msg').hide();
                 }
              });

             $("#submit").click(function(){
                console.log("here");
$("#popup-modal").modal('closeModal');
                    $('#reason_id').prop('selectedIndex',0);
                    $("textarea[name='field2']").val('');

             });
      });
});

require(
[
    'jquery',
    'Magento_Ui/js/modal/modal'
],
function($,modal
) {
    $(document).ready(function() {
    $('#popup-modal').on('hidden.bs.modal', function (e) {
          $('#reason_id').prop('selectedIndex',0);
         //For reset textarea
    $("textarea[name='field2']").val('');
        });
    });

$('#popup-modal').on('modalclosed', function() {
           //For reset Select field
    $('#reason_id').prop('selectedIndex',0);
         //For reset textarea
    $("textarea[name='field2']").val('');

});

      $(".cancel_order").click(function(){
         $("#popup-modal").modal('openModal');
      });
        var options = {
        type: 'popup',
        responsive: true,
        innerScroll: true,
        cache: false,
        title: 'Select a Reason to Cancel',
        modalClass: 'custom-modal',
        buttons: [{
            text: $.mage.__('Continue'),
            class: 'module_pop',
            click: function () {
                    $('#reason_id').prop('selectedIndex',0);
                             //For reset textarea
                    $("textarea[name='field2']").val('');
                this.closeModal();

            }
        }]

    };
    var popup = modal(options, $('#popup-modal'));
    return false;
  }
);

Where am I doing wrong? can I get help?

Thanks in advance


texts: Add to cart button from controller layout cause redirect to controller url

texts: I've got controller that render products in .phtml with add to cart button and return it via layout to ajax. When i hit the add to cart button this makes redirect to controller page. I need to reload current page or add the product via aja. btw i know why this happen, but don't how to fix this. any ideas? thanks!


texts:
I am using magento 2.3.4 version and i am keep getting this error Multiple times

main.CRITICAL: SQLSTATE[HY000] [2002] Connection refused {"report_id":"d953b23017cc156845a623c7225f2e281cf201d080f960026cb40a49fcdaf44b","exception":"[object] (Zend_Db_Adapter_Exception(code: 2002): SQLSTATE[HY000] [2002] Connection refused at /var/www/html/vectorx/vendor/magento/zendframework1/library/Zend/Db/Adapter/Pdo/Abstract.php:144, PDOException(code: 2002): SQLSTATE[HY000] [2002] Connection refused at /var/www/html/vectorx/vendor/magento/zendframework1/library/Zend/Db/Adapter/Pdo/Abstract.php:128)"} []

I tried searching and I found renaming localhost to 127.0.0.1
but this is not working for me how can I solver this error


texts:
I am new in magento2. I saw many question but i can't understand flow.

can any one help me how to call cms page in anchor tag ?

I tried some code but it is not working.

<a href="<?php echo $this->getUrl('footer'); ?>">CMS PAGE LINK

Thanks in advance :)


texts: Variable pricing at different quantity levels

texts:
This is a feature I saw one a competitors non-magento site and I'd love to see something like it on our magento site.

We sell items by the singles, in a full case and in multiple cases. We offer quantity discounts at each level.

For a single, the price on an item might be $1.00 each. If you buy a full case of 50 units, the price might drop to $0.80 each. If you buy 10 full cases (500 units total), the price might drop to $0.70. What we'd like to see is a rational split at each level that, if the customer wants to buy more than that, they are charged multiple prices.

For instance, if they wanted to buy 55 of the units above. Instead of being charged $0.80 x 55 units, we want them to be charged the 50 unit price (one full case) for the first 50 units and then the per unit price on the other pieces, so it would be 50 x $0.80 = $400 + 5 x$1.00 = $5 for a total of $405.00. In this case, let's say they wanted to buy 560 units. They would pay for the 500 units at $0.70 each, then the 50 units at $0.80 each then the last 10 units at $1.00 each. This would output in the cart with all 3 prices shown.

I've attached a screenshot of how this is done by our competitor. Is there an existing plugin/extension that does this? If not, who should we talk to about creating one?

thanks!


texts: Mage 2 Customer Token Error For Some Accounts

texts:
I have website with 5 customer test accounts. REST API calls have been working for a while now w/o a problem.

Today, one customer account cannot get the customer token via REST API call (API response 401: "You did not sign in correctly or your account is temporarily disabled."), the other 4 accounts have no problems.

In the Mage 2 admin, zero accounts are locked. The account in question also shows as UNLOCKED in the account details. In the db > customer_entity table, the related account record has failure_nums = 0, lock_expires = null - same as all other accounts that work. We reset the password for the account, still the API does not authenticate this account.

Using the web front-end log in, the account does log in using the same email/pw used in the API call.

Any idea what is going on here with this one problematic account ?

This is a test environment, so not critical atm, but do not want to run into this in production.


texts:
So I am trying to rewrite _prepareColumns() function in Mage_Adminhtml_Block_Cms_Page_Grid class.

I created a module with a config.xml:

<?xml version="1.0"?>
<config>
    <modules>
        <Jurgis_Gridrewrite>
            <version>0.0.1</version>
        </Jurgis_Gridrewrite>
    </modules>
    <global>
        <blocks>
            <adminhtml>
                <rewrite>
                    <Cms_Page_Grid>Jurgis_Gridrewrite_Block_Adminhtml_Cms_Page_Grid</Cms_Page_Grid>
                </rewrite>
            </adminhtml>
        </blocks>
    </global>
</config>

And app/code/local/Jurgis/Gridrewrite/Block/Adminhtml/Cms/Page/Grid.php:

<?php
class Jurgis_Gridrewrite_Block_Adminhtml_Cms_Page_Grid extends Mage_Adminhtml_Block_Cms_Page_Grid
{

    protected function _prepareColumns()
    {
        //content
    }

}
?>

(My rewrite works if I just place the Mage file in the local folder)

My module is active. I cannot spot my mistake.


texts:
I have this tree of categories in magento with main>subcat>subcat1. 3 levels. I want to sort the first two levels with custom order and the subcategories of the second level alphabetically.
I found catalog_category_entity table and I am sorting each categories one by one.
The problem is that I have 900 categories and this is a waste of time.
I don't know about databases but is there some queries:
1)to select main categories so I can order them custom
2)to select subcategories for same reason
3)to select the third level of categories and sort the automatically in alphabetical order


texts: Magento 2.3 my account login it says i am not subscribed

texts:
When I created my user account, I selected to subscribe to newsletter.
But in my account login it says I am not subscribed.
I checked in the admin backend. It says I am not subscribed also. But I did select the option
Please help me.
Thank you in advance!!!


texts: How can I apply the Google AMP on my Magento 2 store without using a paid module?


texts: Get email header and footer in phtml file?

texts:
I want to get email header and footer template in phtml file.

<!-- Here I want to send mail with header and footer template -->
$body = "Some Data";
$mail = Mage::getModel('core/email');
$mail->setToName('Name');
$mail->setToEmail('Set To Email');
$mail->setBody($body);
$mail->setSubject('Subject');
$mail->setFromEmail('Set From Email');
$mail->setType('html');
$mail->send();


texts:
OK so I have a a PHP file that sends data to the Database and therefore has the username and password etc hard coded into the file.

I am not comfortable with this as I beleive there is a security risk.

Is there anyway I can pull these credentials from somewhere else? maybe using some sort of variable etc

here is how the details are stored:

$ct_host      = ($_SERVER['SERVER_NAME'] === 'localhost') ? 'localhost' : 'localhost';
$ct_username  = ($_SERVER['SERVER_NAME'] === 'localhost') ? 'root'      : 'username';
$ct_password  = ($_SERVER['SERVER_NAME'] === 'localhost') ? 'pass'      : 'password';
$ct_database  = ($_SERVER['SERVER_NAME'] === 'localhost') ? 'phpdevel'  : 'databasename';


texts:
I am unable to connect to generate the sessionid using soap api in magento1.9.

I am getting the following error message:

  Fatal error: SOAP-ERROR: Parsing WSDL: Couldn't load from
  'https://test.com/api/soap/?wsdl=1' : Premature end of data in tag
  html line 3

Thanks


texts: What settings are needed to prevent 504 Gateway Time-out when deleting all products?

texts:
I am deleting all products in my magento 2 system.
There are about 1200 products in my catalog.

When I select all and delete, after 60 seconds I get a 504 Gateway Time-out on Nginx.

What are the recommeneded settings in this case?


texts:
When I enter a malformed product view URL, or something similar where the URL is correct but can't be handled (invalid ID for example) Magento sends me to the "CMS No Route Page" in Configuration > Web > Default Pages, but if I type in a totally bogus URL it gives me the "Error Processing Request Page" or the Stack Trace when developer mode is enabled.

Is there any way to have the "No Route Page" catch the request in these cases as well? The exception page that gets displayed isnt very user friendly and doesn't link back to the site.


texts: Magento 2: Not Allow to Rest Estimate Shipping and Tax value on qty change in checkout/cart/ page

texts:
After Adding a product into the cart I go to checkout cart page and fill the Estimate Shipping and Tax data it is set fine. after that I refresh the page and again check Estimate Shipping and Tax data it is same as which is I set.

Now I Change the Qty of that product in the cart and hit the update button after page load successfully again, I check Estimate Shipping and Tax from data which is reset.

So how to prevent rest Estimate Shipping and Tax from data on Qty update.


texts: Magento 2 : Delivery Calendar in before-shipping-method-form

texts:
We are adding a delivery calendar using before-shipping-method-form using knockout.

We need to get delivery address postcode, so that we can pass this in a json request to get relevant information from our delivery system? I have tried quote.shippingaddress but this doesn't work with a guest checkout.

Does anybody have any ideas on how to achieve this so that it updates if the customer changes the postcode.


texts:
When I click the checkout I get the popup to register or sign in.
I have the the configuration correct as a guest checkout.

I Enable Persistence is set NO. under Sales > Checkout > I have Allow the guest checkout to YES. I am still getting the popup.

Am I missing something? However, when I refresh my checkout page and then click the checkout the 2nd time, I am redirected to checkout page as a guest no popup.

Any suggestion?


texts: Full Class Names in Magento's Factory Methods

texts:
In Magento 1, if I use the full Magento class name in a factory method, I'm able to instantiate an object

//trying full class name instead of catalog/product
$object = Mage::getModel('Mage_Catalog_Model_Product');

However, the same thing won't work for helpers.  If you try

Mage::helper('Mage_Core_Helper_Url');

You get

Warning: include(Mage/Mage/Core/Helper/Url/Helper/Data.php): failed to open stream: No such file or directory  in /path/to/magentolib/Varien/Autoload.php on line 93

#0 /path/to/magentolib/Varien/Autoload.php(93): mageCoreErrorHandler(2, 'include(Mage/Ma...', '/path/to/magent...', 93, Array)
#1 /path/to/magentolib/Varien/Autoload.php(93): Varien_Autoload::autoload()
#2 [internal function]: Varien_Autoload->autoload('Mage_Mage_Core_...')
#3 /path/to/magentoapp/Mage.php(547): spl_autoload_call('Mage_Mage_Core_...')
#4 /path/to/magentoapp/code/local/Sebastianjuffar/Commercebug/controllers/IndexController.php(11): Mage::helper('Mage_Core_Helpe...')
#5 /path/to/magentoapp/code/core/Mage/Core/Controller/Varien/Action.php(418): Sebastianjuffar_Commercebug_IndexController->indexAction()
#6 /path/to/magentoapp/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('index')
#7 /path/to/magentoapp/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#8 /path/to/magentoapp/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#9 /path/to/magentoapp/Mage.php(684): Mage_Core_Model_App->run(Array)
#10 /path/to/magentoindex.php(87): Mage::run('', 'store')
#11 {main}

What's going on?


texts:
I am developing API to get the navigation filters in catalog and search results page.
Using the below code I'm able to get the available filters for a category. I need apply any of the filters to the category and should get the resulted navigation filter. Same this has to be done for search results page also.

$categoryId = 3;
        $this->layerResolver->setCurrentCategory($categoryId);
        $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
        $fill = $objectManager->create('Magento\Catalog\Model\Layer\Category\FilterableAttributeList');
        $filterList = new \Magento\Catalog\Model\Layer\FilterList($objectManager,$fill);
        $filterAttributes = $filterList->getFilters($this->layerResolver);
        $filterArray = array();
        $i = 0;

       foreach($filterAttributes as $filter)
       {
           //$availablefilter = $filter->getRequestVar(); //Gives the request param name such as 'cat' for Category, 'price' for Price
           $availablefilter = (string)$filter->getName(); //Gives Display Name of the filter such as Category,Price etc.
           $items = $filter->getItems(); //Gives all available filter options in that particular filter
           $filterValues = array();
           $j = 0;
           foreach($items as $item)
           {
               $filterValues[$j]['display'] = strip_tags($item->getLabel());
               $filterValues[$j]['label'] = $item->getValue();
               $filterValues[$j]['count'] = $item->getCount(); //Gives no. of products in each filter options
               $j++;
           }
           if(!empty($filterValues))
           {
               $filterArray['availablefilter'][$availablefilter] =  $filterValues;
           }
           $i++;
       }
        return array($filterArray);

Is there any possible way to get navigation filters for a product collection so that it will work for both category and search pages.


texts: How to redirect all urls to index.php except 1 url with htaccess

texts:
I have set up htaccess to redirect all urls to homepage. Now I need one url to be exempted from that rule. How can I best do that?

The url that needs to be exempted is:

mywebsite.com/fulfilmentsoftware/index/cron

This is what i use to redirect all url to homepage:

RewriteRule .* index.php [L]

Looking forward to hear from you guys! Thanks in advance


texts: How to update the attribute type in Magento 2?

texts:
I have to change the type of an attribute from text to decimal. I used upgrade script below. But it is not working

use Magento\Eav\Setup\EavSetup;
use Magento\Eav\Setup\EavSetupFactory;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\ModuleDataSetupInterface;
use Magento\Framework\Setup\UpgradeDataInterface;

class UpgradeData implements UpgradeDataInterface
{

    public function __construct(EavSetupFactory $eavSetupFactory)
    {
       $this->eavSetupFactory = $eavSetupFactory;
    }

    public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
    {
        /** @var EavSetup $eavSetup */
        $eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);

        if (version_compare($context->getVersion(), '1.0.1', '<')) {

            $entityType = $eavSetup->getEntityTypeId('catalog_product');

            $eavSetup->updateAttribute($entityType, 'as_low_as', 'frontend_input','decimal', null);
        }
    }
}

How can we update the attribute type of an existing attribute?


texts: Add field on registration form for specific website

texts:
I created a custom module that add a field to the registration form and account modification.
The problem is that it is added to all websites. I only need it on a specific website.
This is the module I created:
https://github.com/stfn97/magento2-custom-registration-field


texts:
I have changed the default sort by to reference one of our attributes so the best sellers get listed first, It works perfectly via this code

public function setListOrders()
{
    $category = Mage::getSingleton('catalog/layer')
        ->getCurrentCategory();
    /* @var $category Mage_Catalog_Model_Category */
    $availableOrders = $category->getAvailableSortByOptions();
    unset($availableOrders['position']);
    $availableOrders = array_merge(array(
        'best_sellers' => $this->__('Best Seller'),
        'relevance' => $this->__('Relevance')
    ), $availableOrders);

    $this->getListBlock()
        ->setAvailableOrders($availableOrders)
        ->setDefaultDirection('desc')
        ->setSortBy('best_sellers');

    return $this;
}

As you can see i have set the direction to descending, However when ever i change the sort by attribute  (ie name, relevance or price) it changes the order to ascending, how can i change it so it always stays on descending unless the customer changes it?

Cheers


texts: How to validate the Tax / VAT Number field depending on whether it is a European country or not

texts:
I have a question about how to make the Tax / VAT Number field validate depending on the selected country in the the registration page and the configuration page.
Is there a way to do it in the admin configuration or should it be done with javascript?
Greetings and have a good day!
Angel


texts:
I want to programmatically clear manual log-files in order to always only see the new Logging Code for the last iteration.

Is it possible (e.g. via a parameter) to only log the last iteration with the call

Mage::log("My Test Log", null, "test.log")

Or do I always have to manually delete the content of my manual log files?

Do you have a good idea, how can I achieve this with minimum effort?


texts: Customer email is required pay via PayPal Express Checkout error

texts:
Getting an error 'Customer email is required' when clicking on the Place Order button while checking out using the guest account.

Check this link:
https://www.nextdaygames.com/gran-turismo-sport-playstation-4

Click on Buy Now Button->Pay with a sandbox account with PayPal->Place Order from review page. Check Attachment.


texts: Is there an option to create different user groups by default?

texts:
I have created some prestashop sites and there is the option by default to create different user groups

example:

guest login (when visitors like to buy without registering)
customer login (when the want to create an account)
dealer login (for b2b clients)

the last group can also be assigned to pay by invoice

Is this also possible in Magento CE or would i need an extension for that?


texts: checkQuoteItemQty using wrong qty for configurable product

texts:
I have a configurable product with associated simple products which I want to keep Inventory of. I set all the inventories to 10.

I've noticed that if I try to add 4 products to my cart, it won't let me. It says The requested quantity for [product] is not available.

I started digging for a solution.
I found that in app/core/Mage/CatalogInventory/Model/Stock/item.php in the function checkQuoteItemQty, I'm getting funny values.

This function gets called from the observer located one folder up, Observer.php.

I started logging the parameters fed to checkQuoteItemQty and have found that it is squaring my requested quantities. If I order 3 products, it checks inventory for 9. When I order 4, it looks for 16 (which is above the limit of 10).

The observer runs for each Item in the quote. The quote has the simple product AND the configurable product in it. And the observer has a line
$rowQty = $quoteItem->getParentItem()->getQty() * $qty; that is multiplying the two, and yielding the incorrect rowQty.

This seems too asinine to be the default behavior. Do I have something configured wrong? Why are the simple AND configurable products in the quote? Or why do they both have an qty value (of 4, in my case)


texts: Magento 1.9 Customer Group Display Price Without Tax

texts:
I have created a Tax Free Customer Group, so when a customer logged in, the price should be displayed without tax. And this is working find on a clean Magento installation.

When I implement this on my live site, all prices are displayed with tax. It simply ignored my Tax Free Customer Group.

I have the following code to display price, which is the same code as in a clean Magento installation.

$this->helper('checkout')->formatPrice($this->getTotal()->getValue())

Any reason why this code doesn't take customer group in consideration?

PS: I've also checked the admin, which is the same setup as in a clean Magento installation, where the tax free customer group worked.


texts:
I'm able to fetch data from custom form but not able to put it in database table.

    $model = $this->_name->create();
    $entity = $this->getRequest()->getParams();
    $model->addData([
        "entity_id" => $entity['entity_id'],
        "customer_id" => $entity['customer_id'],
        "position" => $entity['position'],
        "department" => $entity['department']
    ]);

    $saveData = $model->save();

    if($saveData)
    {
        $this->messageManager->addSuccess('Record Inserted...!');
    }
    else
   {
      $this->messageManager->addSuccess('Record Inserted...!');
   }

SimpleMagento\Custom\Model\Name.php

class Name extends \Magento\Framework\Model\AbstractModel

{
    public function _construct()
    {
        $this->_init('SimpleMagento\Custom\Model\ResourceModel\Name');
    }
}

SimpleMagento\Custom\Model\ResourceModel\Name.php

class Name extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb

{
    public function _construct()
    {
        $this->_init("new_info","entity_id");
    }
}

SimpleMagento\Custom\Model\ResourceModel\Name\Collection.php

class Collection extends \Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection

{
    public function _construct()
    {
        $this->_init("SimpleMagento\Custom\Model\Name","SimpleMagento\Custom\Model\ResourceModel\Name");
    }
}


texts: sitemap not generated properly in magento 1.9.1

texts:
I am trying to generate google sitemap using Magento default functionality. It goes to infinity after some urls. I have 13000+ products in my store. My CMS and category sitemap generated but when start to product its goes to infinity.

Can anyone please help me what is the problem with my store.


texts: Getting footer and header in an external script?

texts:
Magento 1.9
I created an external script in my root folder. It contains these lines in order to work:
require '../app/Mage.php';
Mage::app();

How can I get the header and footer? Is it possible at all?