texts: Send Email and Save Data to database table with custom form

texts:
I have created the module with a form in front end on submit it send email and its working fine, now i also want to save the current form data to a Database table and keep the email functionality too that is working fine right now:

Here is the form action:

<form id="simple_contact_form" name="simple_contact_form" action="<?php echo $this->getUrl('reviews/email/sendemail') ?>" method="post">

And here the function to in my module to send email:

       <?php
        class OptFirst_ReviewMyCompany_EmailController extends
        Mage_Core_Controller_Front_Action
        {
        public function sendemailAction()
        {
         $params = $this->getRequest()->getParams();
          $mail = Mage::getModel('core/email');
    $body = '
Hello,

A New CLient Review Is Received:

Name: ' . ($params['name']) . '

Email: ' . ($params['email']) . '

    Comments: ' . ($params['comment']) . '
';
    $mail = new Zend_Mail();
    $mail->setBodyHtml($body);
    $mail->setFrom($params['email'], $params['name']);
    $mail->addTo('techleadz.wpteam@gmail.com');
    $mail->setSubject('Review Form');

    try {

        $mail->send();
        Mage::getSingleton('core/session')->addSuccess('Message has been Sent Successfully.');
        $this->_redirect('reviews/');
         }

    catch (exception $ex) {
        Mage::getSingleton('core/session')->addError('Unable to send email. Sample of a custom notification error from Contact Us Form.');

    }
     $connectionresource = Mage::getSingleton('core/resource');
$connectionWrite = $connectionresource->getConnection('core_write');
$table = 'optfirst_contacts';
$query = "insert into ".$table." "
                 . "(name,email,comments) values "
                 . "(:name, :email, :comments)";

          $binds = array(

              'name'   => 'values',
              'email' => 'values',
              'comment' => 'values',

          );

          $connectionWrite->query($query, $binds);
    $this->_redirect('reviews/');

   }
  }

created the query to save data to DB table but it throws an error:

Invalid parameter number: parameter was not defined

What is wrong going on here any help?


texts:
I am trying to bring banner scroll in magento2. I am using owl carousel for this purpose. Everything have done and implemented and is showing in firefox without any errors. But when checked in chrome, i found jquery not defined error. After some diggings, i found we need to use call it as "require" to trigger jquery. So i have modifed the js and still firefox is rendering everything correctly, but in chrome its still the issue.
Script currently i have

require([ 'jquery', 'jquery/ui'], function($){

   $("#owl-demo").owlCarousel({
        items: 1,
        autoplay: true,
        autoplayTimeout: 5000,
        autoplayHoverPause: true,
        dots: false,
        nav: true,
        navRewind: true,
        animateIn: 'fadeIn',
        animateOut: 'fadeOut',
        loop: true
    });

});

I have tried different kinds, but every time chrome is giving me this error see

could anybody assist me in this? Thanks.


texts: How to Obtain Unique Records in a Collection/Varien_Db_Select

texts:
I"m gettin a collection from our database.  It contains a number of sku->sku relationships.  A single sku can repeat several times but none of the relationships are identical. How do I generate a unique amount of the first sku?

table looks something like this:

entity_id | first_sku | second_sku | quantity

Thanks


texts: Magento2 change label of phone number field

texts:
I want to change all instances where the "phone number" field is listed to instead be labeled "Mobile Phone number" . I edited the file app/design/frontend/Smartwave/porto/Magento_Customer/templates/widgets/telephone.phtml recompiled and redeployed however I still see the text input labeled Phone number instead of mobile phone Number ??

Where else do I need to edit this so in the frontend and backend the field is labeled as I need it to be.


texts: Radio button not clicked while using ko in Magento 2, anybody have idea?

texts:
when using like below standard in knockout js radio button click,

data-bind="click: submitValue.bind($data,'5','129.00')">

the radio button option not clicked (though I have used return true in the submitValue function), but if I use like this,

data-bind="click: submitValue('5','129.00')">

It works.

Do we have any specific reason on that?


texts: Set Sort order for Product Images and Save Programatically

texts:
I have an option to add products and its images in frontend. All the product details are saved correctly.But I want to set sort order for each image.

Below is the code to store product images,it's working good. But with this I want to set sort order also.

foreach($_FILES['images']['name'] as $key=>$files)
{
    $absolute_path = Mage::getBaseDir('media').DS.'catalog'.DS.'product'.DS.$f.DS.$s.DS.$files;

                $mediaArray = array(
                        'thumbnail'   => $absolute_path,
                        'small_image' => $absolute_path,
                        'image'       => $absolute_path,
                    );
                    foreach($mediaArray as $imageType => $files)
                    {
                        $filePath = $files;
                        if(file_exists($filePath))
                        {
                            try
                            {
                                $product->addImageToMediaGallery($filePath, $imageType, false, false);
                            }
                            catch (Exception $e)
                            {
                                echo $e->getMessage();
                            }
                        }
                        else
                        {
                            echo "Product does not have an image or the path is incorrect. Path was: {$filePath}<br/>";
                        }
                  }
}


texts: Manufacturer attribute applicable to configurable product at Magento 2.2.5

texts:
Unfortunately, I have the same problem:

How to make the manufacturer attribute applicable to configurable product in Magento 2.2?

The changes at 'apply_to' and the reindex had no success to me :-(

The attribute manufacturer at the backend has the id 83 in the url....

https://www.***.de/shop/admin_***/catalog/product_attribute/edit/attribute_id/83/key/*****/

but with:
SELECT * FROM eav_attribute WHERE attribute_code = 'manufacturer'

i get an attribute_id = 81

Magento Ver.-2.2.5

Anyone else has a idea?

Thanks :-)


texts:
I'm extending the Magento Blank theme and I'd like to move the catalogs main navigation to the sidebar (it should be displayed vertically instead of horizontally)

I simply removed the original top navigation from the page with the following update in the Magento_Theme layout default.xml

<referenceContainer name="page.top">
    <referenceBlock name="catalog.topnav" remove="true" />
</referenceContainer>

But I can't figure out how to add it to the sidebar via xml updates.


texts: Category products are gone after installing solr on Magento Enterprise 1.14

texts:
I have installed Solr version 3.6.2 on EE 1.14 version of Magento. Solr is working fine, when I visit http://localhost:8983/solr/ , but all category products are disappeared from catalog, and on searching a keyword no result is showing other than related search terms.

I have not set up any schema or Solr docs for this, please provide some suggestions.

Thanks,

Abhilash


texts: Order canceled automatically after payment complete Magento 2.2.11

texts:
When a customer ordered in guest mode the payment was made successfully (full) and the status automatically changed to canceled on Magento 2.2.11, I don't know for what reason.
He paid by Credit Card and we only noticed it a week later when he contacted customer support, any idea where it might be or how to find the root of the problem.
Has anyone ever had this behavior of an order being automatically canceled without anyone changing the status to canceled?


texts: Magento LayoutXML Update Default Products per Page Grid

texts:
I cannot edit my magento theme for now - I'm trying to do this through the back admin. I am also by no means an expert, so please forgive me.

I need one category to have a default grid value of 48 products instead of our set default value of 24. 48 is a value that is allowed in our product grid.

I tried the following code by entering it into the category Design Layout Update XML section, but it is not working.

<referenceContainer name="content">
<block class="Magento\Theme\Block\Html\Pager" name="product_list_toolbar_pager"><action method="setDefaultGridPerPage">
<argument name="limit" xsi:type="string">48</argument>
</action>
</block>
</referenceContainer>

How can I go about changing the default value via back admin?

Thanks in advanced!


texts:
I have change the pagination URL from p to page like below:

magento/test.html?page=1

But when I click on any pagination, product page shows same product on every page.

If I change from page to p in URL then it works.
I need to know how do I change p to page in model.
Currently I have overridden the Mage_Page_Block_Html_Pager class.


texts: How to edit current Billing and Shipping address in checkout page

texts:
How can I edit current Billing and shipping address and update the same address in customer address table?

Currently We are only adding a new address, but I need to edit current address and same edited field update on customer address entity table.


texts: Convert Mage::log Statement to Magento 2

texts:
I want to convert this code from Magento 1 to Magento 2 , it is normally converted like this but I think there is an error

Code In Magento 2 but still Mage::log exist

    foreach ($results['data'] as $data) {
        if ($data->countryCode != $params['countryCode']) {
            Mage::log($data->countryCode . ' - ' . $params['countryCode'], Zend_Log::DEBUG, 'cap.log');
            Mage::log($results, Zend_Log::DEBUG, 'cap.log');
            unset($results['data']);
        }

The code checked

foreach ($results['data'] as $data) {
            if ($data->countryCode != $params['countryCode']) {
                $this->logger->debug($data->countryCode . ' - ' . $params['countryCode']);
                $this->logger->debug($results);
                unset($results['data']);
            }

Additional code for better comprehension of the problem

use Psr\Log\LoggerInterface;
class xxxx extends yyyyy
{
    /**
     * @var  $logger
     * */
    protected $logger;

    /**
     * @var Data
     */
    protected $helper;

    /**
     * xxxx constructor.
     * @param Data $helper
     * @param LoggerInterface $logger
     */
    public function __construct(
        Data $helper,
        LoggerInterface $logger
    ) {
        $this->helper = $helper;
        $this->logger=$logger;
        parent::__construct();
    }

Thanks in advance,


texts:
I created a customer account directly in Backend based on a phone conversation. Over a while I discovered there is an account with the same data created a year ago by the customer.

I would like to ask:

Why Magento 1 allows two customers with the same data? Why I was not warned by Magento there is already a customer with that email address?
Where will go the orders created by the customer, to ID 3 or 4?
Where will go the orders created in Backend using the account created by administrator, to ID 3 or 4? As I see even I am using this account there are no orders associated to it, all orders will go to account with ID 4.

I recreated this behavior in a test environment and see the image bellow. Two customers with the same data.


texts: Cart count only showing on checkout pages in Magento 2

texts:
I've added a custom cart count in header on my Magento 2 theme and the count is only displaying correctly on checkout pages. Any idea how to resolve so it displays on all pages correctly?

I'm calling in a static block like so:

          My Cart {{block class="Magento\Checkout\Block\Cart\Sidebar" name="menu.minicart" template="Magento_Theme::additional/header/menu-cart.phtml"}}

And the menu-cart.phtml file:

<?php
$counter = $this->helper('\Magento\Checkout\Helper\Cart');
if ($counter && $counter->getSummaryCount()) {
    echo '(' . $counter->getSummaryCount() . ')';
}


texts: Magento 2.3 Product Category not showing changes on frontend

texts:
I am wondering if anyone can help.

I have made some design changes to the following category: https://www.valvesonline.co.uk/manual-valves/ball-valves.html

However these changes do not appear on the front end. The category title and description should be in the left hand column and the top image shouldn't even be showing. I am using layout update XML to make the changes and know it works, as I have made the changes to all other categories and they work fine.

I have cleared the cache, disabled and re-enabled the category and double checked but it isn't working.

Any advice would be appreciated.

Many thanks


texts: Magento 1.9 Parse error: syntax error, unexpected '$od823' (T_VARIABLE) in /var/www/new/includes/src/Zend_Http_Response.php on line 1

texts:
How to resolve this error?

  Parse error: syntax error, unexpected '$od823' (T_VARIABLE) in /var/www/new/includes/src/Zend_Http_Response.php on line 1


texts:
Magento is still very much a learning curve for myself but I'm trying to steer away from so much of my hard-coded, procedural PHP and start following the Magento MVC. I've set myself the task of converting a singular .phtml file that I've created a best-sellers carousel for into an extension that follows the proper MVC. Here's my code/files:

app/code/local/Liam/Interested/etc/config.xml:

<?xml version="1.0"?>
<config>
<global>
    <modules>
        <liam_interested>
            <version>0.1.0</version>
        </liam_interested>
    </modules>
    <blocks>
        <interested>
            <rewrite>
                <interested>Liam_Interested_Block_Interested</interested>
            </rewrite>
        </interested>
    </blocks>

</global>
</config>

app/code/local/Liam/Interested/Block.php:

<?php
class Liam_Interested_Block_Interested extends Mage_Core_Block_Template
{
    // necessary methods
}
?>

app/etc/modules/Liam_Interested.xml:

<?xml version="1.0"?>
<config>
    <modules>
        <Liam_Interested>
            <active>true</active>
            <codePool>local</codePool>
        </Liam_Interested>
    </modules>
</config>

app/design/frontend/custom/default/template/interested/interested.phtml:

<?php
echo 'test';
?>

Then, in my CMS - I'm adding:

{{block type="interested/interested" name="interested_interested" template="interested/interested.phtml"}}

This was based on following a guide online, but I still can't seem to get my head around it all!


texts:
I suspect that the permissions might have gotten messed up on my Magento 2 installation. On the old versions I would run the following command to make folders 755 and files 644:

find . -type f -exec chmod -c 644 {} \; && find . -type d -exec chmod -c 755 {} \;

Can you please let me know what the correct file and folder permissions are for Magento 2 since they seem to be different? Also, if there are some particular folders or files that would need different permissions.


texts: Error class Mage_Sintax_Helper_Data not found while opening the admin

texts:
In my magento CE 1.6.2.0 i am getting this error suddenly actually i was trying to develop an extension which is not activated yet.

  Fatal error: Class 'Mage_Sintax_Helper_Data' not found in
  C:\wamp\www\magento\app\Mage.php on line 516

I have tried finding it o Google but no luck :'( any body having any idea about it.


texts: difference tables 'quote' and 'quote_adress"

texts:
What is the 'quote' table for? And what is the difference between 'quote' and 'quote_adress' table ?

Does anyone know what is the difference ? Thanks in advance.


texts: Magento new notification emails not being sent to Store Owner

texts:
When order is placed user/buyer gets an email notification that he made a purchase. That's fine.

But did Magento developers thought that the store owner should also be  notified about new order?

I believe I have done everything correctly with the cron.

I can see that table core_email_queue has 3 emails in it and they don't get cleared i.e they are not being sent.

I've setup emails correctly in Magento backend and even installed SMTP Pro extension but this doesn't help also. Emails to customer after order being placed are sent fine, contact form from store frontend works great also, the only thing I can't figure out is why the Store Owner doesn't receive the email about new order.

I have tried cron.php and setting up the cron job to execute this file and nothing has worked so far.


texts: How to define custom Max order amount input field for flat shipping rate method? (Magento2)

texts:
I want to add an input field called "max order amount" for my flat rate shipping method, so that it is hidden when the order amount is higher than the configured amount.

What possible changes i have to do in code for achieving this condition please let me know in detail as i am beginner :)

Edit:

Ok guys so for that i find a file where i write this code in
vendor/magento/module-offline-shipping/etc/adminhtml/system.xml

<field id="flat_shipping_subtotal" translate="label" type="text" sortOrder="2" showInDefault="1" showInWebsite="1" showInStore="0">
    <label>Max Order Amount</label>
    <validate>validate-number validate-zero-or-greater</validate>
</field>

inside my flat shipping method. It now shows text field in the administration panel, but obviously its not working yet. I guess I must define somewhere else how to enforce the restriction. Where would that be?


texts:
I want to fix a website that was done by another person but I do not want to break the live version of it. So I downloaded the whole website completely and the live database, installed everything on a local web-server and fixed "core_config_data" table (web/secure/base_url, web/unsecure/base_url) and "local.xml" file.

The main page is just wrong, it's all scuffed. I inspected the code and it seems to show some other template in general. Some menus are wrong and some elements do not even exist in it. But I copied the whole website, how is it possible that I receive incorrect output by pretty much copypasting the code?

I do not know how to debug this, Magento seems huge, I would love to hear suggestions and, possibly, steps for debug process.
Thank you.


texts: How to Add Custom Column in Sales Order Table and Display in Admin Grid and Sales order view?

texts:
I want to add a custom attribute in sales order table I have added it using db_schema it is also showing in DB but how will I show it on admin grid and sales order view I also want to change it from admin panel and when creating order from admin it should also show there.Path to my module using is app/code/EAV/OrderAtt. Here is my db_schema file:
<schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"      xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd">
<table name="sales_order" resource="sales" engine="innodb" comment="Sales Order">
<column xsi:type="datetime" name="delivery_date" nullable="true"  comment="Delivery Date"/>
</table>
</schema>

Please tell which files do I need for this? I am using magento 2.35.


texts: How to get catalogsearch/result page content on a cms page

texts:
I have Magento version 1.9.2.1. When I search for some query_string then url becomes http://domain.com/catalogsearch/result/?q=query_string.

But I want to get same result on different url and url will be http://domain.com/custom/query_string
OR http://domain.com/query_string.

Is it possible to get search result with different url?


texts: Something went wrong while saving this configuration Warning: is_file() expects parameter 1 to be a valid path, string

texts:
I have been trying to figure out how to crete two stores, e.g. one for UK and one for Germany. Each should have its own base currency which products are priced (just like amazon)

i have been told this maybe possible, so created an additional site, web and view (so now I have 2 of each).

Next issues are how to change the default "store" currency for the second on (not found this option yet), and how to actually access the second store.  I tried using a subdomain, e.g. "second_store.mydomain.com" rather than www.mystore.com. I set this URL in the "Base URL" in stores->settings->configuration->general->web, choosing the second store from the dropdown. But when I hit this URL, I get a 404 (I set the DNS to the same ip).

My prefered option would be to have www.mydomain.com/store1.  I am guessing this "Add Store Code to Urls" does this.  However, when I set this to yes, I get this error:

"Something went wrong while saving this configuration: Warning: is_file() expects parameter 1 to be a valid path, string given in /var/sites/j/mystore.store/public_html/vendor/colinmollenhour/cache-backend-file/File.php on line 545"

I am using php 7.1, magento 2.3.0

I do not know if the command worked. I have not found a way yet to access the second website.  Certainly www.mystore.com/xx where xx is the second site code does not work (404)

Any suggestions, or has someone written a guide?


texts: URL Rewrite and 301 Permission not working properly

texts:
I am facing problem in url rewrite.

My problem is I want to redirect a page to root/mods/myvapelife-mod.html with 301 redirection but it is not happenning.

I have deleted old one url rewrite and created new url rewrite but I get a 404 error page not found.
I recreated old one same as old one here is its snap

It is working but problem is it does not redirect as 301.

Whenever I am changing to 301 permission for this then target url becomes root/catalog/category/view/id/48 which I don't need. I need url like root/mods/myvapelife-mod.html.
I have tried like this

But it is resulting 404 ERROR Page Not Found.

Please help me fixing the issue.


texts: Magento 2: How to set up Paypal Payflow Pro Sandbox?

texts:
Can someone provide clear instructions on how to set up Magento 2 to work with a Paypal PayflowPro Sandbox?

I feel like I've tried every possible combination of user/vendor/merchant id/account id/sub account id/ password and still am getting a 'User authentication failed' error.

My basic set up, per Paypals documentation: I have a sandbox environment set up with a sandbox sub account (Business) with a test@myco.com email address, I have a Manager.paypal.com account set up and have followed the instructions to add the test@myco.com email to the 'Sandbox Seller' field.

In Magento, I have the following fields, per the Magento documentation:

Email Associated with your PayPal Merchant Account
Partner:    Your PayPal Partner ID
User:   The ID of an additional user who is set up on your PayPal account
Vendor: Your PayPal user login name
Password: PW that is associated with your PayPal account.

Which Paypal account information goes with which Magento field?

Does the 'User' field above who is 'set up on your Paypal account' reflect the sandbox environment user? or do I need to create an additional user in the manager.paypal.com account?

Does the Password field require the password from the manager account, or the test@myco.com account? Is the User field the email address of test@myco.com, or the Paypal provided Account ID?


texts: Magento 2 : Product attributes color and size Translate issue

texts:
It is a Configurable product and the default store view is Swedish store and this text Color and size need to be translated in  Swedish but These words are not translated in Swedish ??

I have tried Inline translate but It is not showing the custom text to be added for translation
How can I add a translation for these word SIZE & COLOR


texts:
I want a different style (background-image) for login / logout in the .authorization-link - there seems to be no class-difference whether I am logged in or logged out.

How do I target the login-state in my LESS theme?


texts:
I'm getting the following error after i upgrade magento version to 2.3.5 and try to run php bin/magento setup:upgrade

Auto Increment column do not have index. Column - "value_id", table -
"catalog_product_entity_text"

I tried to add an index as follow in catalog_product_entity_text table but still get the same error message.
Action  Keyname Type    Unique  Packed  Column  Cardinality Collation   Null    Comment
Edit Edit   Drop Drop   value_id    BTREE   Yes No  value_id    1524    A   No


texts: Magento 2.2 move review tab below description with all product reviews

texts:
I have added the following code to 'Magento_Review/layout/catalog_product_view.xml':

<move element="reviews.tab" destination="content" after="product.info.details" />

The above code moved the review tab just below product's 'Details / More Information' container.

But, the Div 'product-review-container' is empty.

Following are descriptive images of before and after moving review tab:

Before moving review tab :

After moving review tab:

Please help me in rectifying this.


texts:
I am overriding the Adminhtml Sales Order Create Items Grid template by using a layout in my custom module:

views/adminhtml/layout/sales_order_create_index.xml

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name='items_grid>
            <action method='setTemplate'>
                <argument name='template' xsi:type='string'>Vendor_Module::order/create/items/grid.phtml</argument>
            </action>
        </referenceBlock>
    </body>
</page>

The problem I am facing is that when the page is loaded via AJAX:
1. Click "Create New Order"
2. Click on a customer
3. Page loads via AJAX and shows the grid.

The grid template that loads is the base grid template (Magento_Sales/view/templates/order/create/items/grid.phtml). If I refresh the page or enter the page directly, it loads the overridden template.

My question is: Where does this template get loaded first and how do I prevent it from loading, or how do I force my template to load every time.


texts: I need to set up the cron job, but I don't know my magento file system owner username

texts:
I am stucked in crontab -u  -e
because I don't know file user name?
How to find it, thanks


texts:
I am using Magento 1.5 and have just updated the ebizmarts mailchimp plugin.  When I returned to the admin the menu and page is blank except for the page header.

I have logged out and back in again and cleared the cache manually but with no luck.

Does anyone know what is going on?

Many thanks in advance.


texts: How to customize product page in Magento 2

texts:
How can I customize the product details page in Magento 2?
Where is the .phtml file or layout for that?


texts: How can products with images be displayed first in category or filter for an entire collection? (list.phtml)

texts:
Magento store owners with thousands of products will no doubt have difficulty getting images and descriptions for every single product. To try and overcome this myself, I found some code that would allow products that contained images to be displayed first.

$this->getLoadedProductCollection()->setOrder('image'/*or small_image*/, 'desc')

The problem is, it only moves product images first per page and not the entire product collection.

Example: Total of 50 products, 30 contain images and descriptions, the remaining 20 do not.

The desired result would be: if the page sorting was done by 10 products per page, the first 3 pages would contain all the products with images and descriptions followed by the remaining 2 pages of products that do not.

How can products with images be displayed first in a category or filter for an entire collection?


texts: Retake certification associate developer Magento 2

texts:
Unfortunately, I didn't pass the M2 Associate Developer exam :( with a score at 63.93%.
So, i'll retake it.

My question is : it will be the same questions or it will be different from the first exam ?

Thank you by advance for your answers!!


texts:
I am using Magento 2.2.3. As you know we can see the promotion rules status at Content -> Dashboard.

But when I delete some promotion rules it is still showing in the dashboard. I have cleared the cache, run the cron and reindexing but content stating dashboard is not updating.

Do you have any clue why it does not update?


texts: Adding additional info in transactional email depending on recipient

texts: Is it possible to edit transactional e-mail template so that some data will be included in an admin copy only? If not just by simple in-file expression, how can I achieve that? I want to insert an own-created layout handle in the message to admin.


texts: Delete Order associated Invoice, Shipments, Creditmemos

texts:
public function execute()
{
    $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
    echo "=========================
";
    $request = $objectManager->get('Magento\Framework\App\Request\Http');
    $order_id = $request->getParam('order_id');

    $registry = $objectManager->get('Magento\Framework\Registry');
    //Delete Order value passed from url - baseurl/ebayorder/index/delete/order_id/145
    $order = $objectManager->create('Magento\Sales\Model\Order')->load($order_id);
    if(!empty($order)){
        $registry->register('isSecureArea','true');
        $order->delete();
        $registry->unregister('isSecureArea');
        echo "Order Deleted...
";
    }
    echo "================
";
}

Above code will delete the order.

Next, want to add delete Invoice, Shipments, Creditmemos that is associated to that order.

Thank You!

Solution

    public function execute()
{
    $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
    echo "=========================
";
    $request = $objectManager->get('Magento\Framework\App\Request\Http');
    $order_id = $request->getParam('order_id');

    $registry = $objectManager->get('Magento\Framework\Registry');
    //Delete Order value passed from url - baseurl/ebayorder/index/delete/order_id/145
    $order = $objectManager->create('Magento\Sales\Model\Order')->load($order_id);
    if(!empty($order)){
        $registry->register('isSecureArea','true');
        $invoices = $order->getInvoiceCollection();
        if($invoices){
            foreach ($invoices as $invoice){
                $invoice->delete();
            }
        }
        $creditnotes = $order->getCreditmemosCollection();
        if($creditnotes){
            foreach ($creditnotes as $creditnote){
                $creditnote->delete();
            }
        }
        $shipments = $order->getShipmentsCollection();
        if($shipments){
            foreach ($shipments as $shipment){
                //Delete shipment
                $shipment->delete();
            }
        }

        //Delete Order
        $order->delete();
        $registry->unregister('isSecureArea');
        echo "Deleted...
";
    }
    echo "================
";
}


texts: how can i prevent replacing “&” with “&” in magento url

texts:
When i click on add to compare link on product listing page my url is changing from

magento.com/personal-care/face.html?dir=asc&order=Normal

to

magento.com/personal-care/face.html?dir=asc&amp;order=Normal

And the above link is breaking.

When I am making a small correction in the above url, by changing &amp; to &. Then it is working fine for me.

I also tried RewriteRule ^(.*)&amp;(.*)$ /$1&$2 [L,R=301] in .htaccess but no luck.


texts: How to apply custom validation in Magento 2 checkout Shipping Address form?

texts:
In Magento2 - I want to apply some custom validation on shipping address form of Magento 2 Checkout. Normally I do it with JQuery but don't know how to apply it in Magento 2.

The validation I want to implement are mentioned below.

Allow only alphabet on some field.
Allow dash (-) , hash (#) , both slash (/ , ) and dot (.) in the address1 field
Allow only digits in the ZIP field
Allow only numbers in PhoneNumber field
Set Max length to 50 for First Name, Last Name and Company
Set Max length to 5 Digits for Zip code.
Set Max length to 20 for City
Set Max length to 10 Digits for Phone Number.


texts: Magento2 : how to set per website is_required custom attribute for account creation form

texts:
I have Magento2 multiple websites. I already added some custom attributes for the customer entity, and I wonder if it's possible to set the is_required field per website.
For example, I have an attribute customer_shop_name.
On the first website (b2b) this attribute will be displayed in the form and required.
On the second website (b2c) this attribute will not be displayed, and should not be required.

Actually, when I created this attribute I set it to be required by default. And now, if I try to create an account on the second website, the field is not displayed, but I cannot create the account because the attribute is required. So I just get an error.

I found this question on stack overflow: https://stackoverflow.com/questions/45131554/change-attribute-data-for-a-store-magento-2
So I tried and succeed about setting scope_is_required through an UpgradeData script, but still, no luck in my account create form.

So I wonder if it's possible, and how?

Thank you for your help.


texts:
I am using Ultimo theme for my website and I want to use their featured product slider shortcode in product pages.

{{block type="ultimo/product_list_featured" template="catalog/product/list_featured_slider.phtml" category_id="4" product_count="8" size="size-xs" is_random="1" block_name="Random Products"}}

I can get the shortcode work by doing adding it from layout.xml and calling the block from view.phtml, what I couldn't do or don't know how to assign the category_id, product_count, is_random parts to the layout.xml or in view.phtml while calling the block.

I want to assign the category_id with the current product's category id and set the number of products in the slider, also the slider products must come randomly with each page refresh. (product_count and is_random can be set via layout.xml)


texts: Changed Secure and unsecure URL on a View. Now admin redirects to the unsecure URL of the View. Why?

texts:
I have 3 stores setup on Magento 2 as follows:

Website --> store_1 --> store_1_view
Website --> store_2 --> store_2_view
Website --> store_3 --> store_3_view

I have changed the unsecure and secure URL in "Stores / Configuration" of one of the views which points to another domain. I think it was the default store.

As soon as I saved the configuration, the "admin" page redirected to the View unsecure URL.

I can not get back into admin as it continually redirects me to the other domain.

Where in the database can I change the settings of the view URL back to the default URL?

I have looked through the database tables, but cannot find the correct table.


texts: How to pass phtml variable in js file in magento2

texts:
This is my phtml file ....

    <?php
$currentCategory = $block->getCurrentCategory();

//echo $currentCategory;
?>

I want to set $currentCategory value in js file and display in alert ...How to set it in js file?


texts: Magento 2 - Image Label returning Product name

texts:
I am trying to display a Product Image but am not able to get the correct data for the Alt Text

$image = $block->getImage($_product, 'category_page_grid');

When I call $image->getLabel() it is returning the name of the Product rather than the Alt Text


texts: How to close the popup modal after showing the success message in magento2

texts:
I need to close the popup modal in magento 2, In my js I have given button as false, I can open the popup, but falied to close it after showing the response messagePlease provide me a solution to close popup modal after showing the response message
Js for reference

function ($) {
            "use strict";
            // Review form
            var x = {
                type: 'popup',
                responsive: true,
                innerScroll: true,
                buttons: false,
                title: "Header contant",
                modalClass: "popup-center abc-product-review",
                clickableOverlay: true,
                heightStyle: "content"
            };
            var a = $('#review-form-content-wrapper').modal(x);
            $(".add-your-review").click(function () {
                var status = $(this).attr('data-status');
                if (status === 'logged in')
                    a.modal("openModal");
                else
                    alert("Please loggin");
            });
return function (config) {
                $('#review-form').on("click", "#review-submit", function () {
                    var form_data = $("#review-form").serialize();
                    var reviewurl = config.url;
                    $.ajax({
                        url: reviewurl,
                        type: 'POST',
                        // Pass the submitted form data to Controller
                        data: form_data,
                        success: function (response) {

                            var returnedData = JSON.parse(response);
                            if (returnedData.status === 'success')
                                $("#success").html(returnedData.messages);
                            else
                                $("#error").html(returnedData.messages);
                        },
                        error: function (response) {
                            var returnedData = JSON.parse(response);
                            $("#error").html(returnedData.messages);
                        }
                    });
                    return false;
                });
            };
        });


texts: Magento 2: Update custom div content after ajax add to cart

texts:
I want to update the content of a custom div when a user adds a product to cart via Ajax.

By using observer I am able to do this when I am not using Ajax Add to Cart functionality, but with Ajax Add to Cart, I could not make it happen.

Can anyone help me accomplish my requirement?


texts:
I'm trying to overwrite Mage_Adminhtml_Block_Sales_Order_Create_Form_Address in the local codepool and within our company namespace. I made the changes within the core codepool just as a proof of concept, which checked out, but upon transferring those changes into local, it stopped working. The class itself doesn't seem to be overwriting the core one.

What I have right now:

class Company_Adminhtml_Block_Sales_Order_Create_Form_Address
    extends Mage_Adminhtml_Block_Sales_Order_Create_Form_Abstract
{
...
}

is at /app/code/local/Company/Adminhtml/Block/Sales/Order/Create/Form/Address.php, mirroring the original file's placement, but within our local namespace.

Within /app/code/local/Company/Adminhtml/etc/config.xml I have:

<config>
    <global>
        <blocks>
            <adminhtml>
                <rewrite>
                    <sales_order_create_form_address>Company_Adminhtml_Block_Sales_Order_Create_Form_Address</sales_order_create_form_address>
                </rewrite>
            </adminhtml>
        </blocks>
    </global>
</config>

I imagine that I just have something misplaced/missing an entry or something that's not configured properly, but I'm not quite sure what. Any ideas or help would be greatly appreciated. Thanks!


texts:
I'm trying to get value from the core_config_data table but when I follow various guides on the internet or previous topics here, it doesn't work..

Disclaimer: I'm new to PHP and Magento in general so I'm not completely sure what I'm doing..

The class is:

class Db
{
    public function __construct(\Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig)
    {
        $this->_scopeConfig = $scopeConfig;
    }

    public function getApiKey()
    {
        $getApiKey = $this->_scopeConfig->getValue('vendor_module/general/ApiKey',
            \Magento\Store\Model\ScopeInterface::SCOPE_STORE);
        return $getApiKey;
    }
}

When I try to instantiate the class by calling $new = Db(); $new->getApiKey; it returns the below error:

Fatal error: Uncaught ArgumentCountError: Too few arguments to function vendor\module\src\Model\Db::__construct(), 0 passed in /xxxxx/src/Model/Db.php on line 23 and exactly 1 expected in /xxxxx/src/Model/Db.php on line 9

I have tried to re-run setup:di:compile
cleared cache folders, removed contents of magento/generated (I don't have var/generation in magento 2.2.0..) and still nothing.

Links I'm aware of: How to get value from `core_config_data` table in Magento 2

https://maxyek.wordpress.com/2015/04/03/building-magento-2-extension-extendedconfig/

http://magehelper.blogspot.co.uk/2015/06/get-system-config-values-in-magento-2.html

Any help will be much appreciated.


texts: cleaning up after a Content Staging/Store deletion

texts:
after trying to use content staging websites to no success and finding them buggy, we removed them.

I've noticed in the database, there are a lot of tables prefixed with s_ .  I believe these tables were created when we creating new staging or store sites called Staging.

They are taking up a lot of room.  Our DB is about 8GB and without the extra tables, it would be a bit under 2GB.

Is it safe to just go into phpMyAdmin and drop the tables?

I have tried this on a development server and everything seems ok but I am wondering if there are any gotchas I am not uncovering before I do it to the production database.

Thanks


texts: Suggestion for Moving Magento to new Server With SSH

texts:
I'm looking for a way to move an installation from a development server to live server.

Generally I have SSH access however this time I don't.

I know theres allot of information on how to do it. Just want to see which is best.


texts:
I have a csv produced with DataFlow->export all products. Some columns seem to be repeated. Does anyone know the difference between the following sets of column names, all of which are found in the default "Export all Products"?

First                       Second
stock_status_changed_auto   stock_status_changed_automatically
use_config_enable_qty_inc   use_config_enable_qty_increments


texts: Facing Problem in find out Customer Issue

texts:
I have an ecommerce website , before 11 august i was getting a very good amount of orders but after that suddenly , orders reduced and my website got down abruptly . I got no clues in the logs . After that when i re hosted , customers session are very less and people are not going to checkout page . I have checked multiple times but not able to find out the issue . Kindly help me asap.

Thanks
Sandeep


texts: How to remove default store view code from URL in Magento 2.1?

texts: I would like to remove the default store view code from the URL in Magento 2.1. How can I do this?


texts: How to get 5 latest order in home page in Magento 2?

texts:
How to Get the latest 5 order in home page in Magento2 with all order details?

Any help would be appreciated.


texts: How to create a product in Magento with Multiple sizes

texts:
I'm trying to learn Magento and how to create a product that comes in different sizes, each with a different price.

I'm running v2.0.2

From what I found through Google (http://www.customerparadigm.com/six-types-of-magento-product-types/) it appears I need to create each product size as a "Simple Product".

So I will do that now.

But then how do I tie them all together to give the appearance in the Store Front that they are one single product with different sizes that get selected from a dropdown box?

Thanks for assisting me to get started with Magento


texts: Magento 2.3.2 - Invalid Form Key. Please refresh the page

texts:
I'm upgrading my Magento version from 2.2.4 to 2.3.2 and While trying to post any request in frontend getting "Invalid Form Key" error. Can't add product to cart, create account, Contact form submit. Nothing is submitting. Any idea how to resolve this?

N.B: Already tried increasing max_input_vars not working.


texts: Using Prompt widget https://devdocs.magento.com/guides/v2.4/javascript-dev-guide/widgets/widget_prompt.html How to show the popup if a customer tries to close the current tab?


texts: How to redirect (& show flash message) on CMS contact page when wrong captcha submitted

texts:
I have added a Contact form in a CMS Contact page.

added Layout Update XML section
added vendor/magento/module-contact/views/frontend/templates/contact.phtml
vendor/magento/module-contact/controller/index/post.php   commented the default redirect at line number 90 & added : $this->_redirect('my_cms_contact.html');

Although on Success captcha, form is submitted and flash message seen on same cms page.
However, when wrong captcha is submitted it redirects to /Contact/index/index
How to redirect to my_cms_contact.html & show flash message, when wrong captcha is entered.


texts: How to add last logged in and last order date information to customer grid?

texts: Using Magento ver. 2.2.6, how can I add new columns to customer grid showing the last logged-in activity and Last order date?


texts:
I am new to magento. I installed "perfume" theme from magento connect. I want to rearrange two templates in the home page which have names as follows:

frontend\base\default\template\page/template/links.phtml
frontend\base\default\template\page/switch/languages.phtml

To do so,  I created a local.xml file in app/design/frontend/default/perfume/layout directory structure and added the following code:

<?xml version="1.0"?>
<layout>
    <default>
        <reference name="root">
          <remove name="footer_links"/>
          <block type="page/template_links" name="footer_links" as="footer_links" template="page/template/links.phtml" before="store_language"/>
        </reference>
    </default>
</layout>

But still I can't see any change in the frontend. What could be the reason?


texts: Why can i pass in unlimited argument as injection in constructor of magento2?

texts:
In my understanding, argument passed to a function/method are strictly mapped to your function call, and the arguments must be arranged in correct order to map what you pass in your function call.

e.g. function test(a,b){
     return ....
}
$result = test(myValue1, myValue2);

But in magento2, when we override a class, we can inject more & more argument as we like ,
e.g.

public function __construct(
        \Magento\Framework\View\Element\Template\Context $context,
        \Magestore\Bannerslider\Model\ResourceModel\Banner\CollectionFactory $bannerCollectionFactory,
        array $data = []
    ) {

After override, one more argument is injected:

public function __construct(
        \Magento\Framework\View\Element\Template\Context $context,
        \Magestore\Bannerslider\Model\ResourceModel\Banner\CollectionFactory $bannerCollectionFactory,
        \Magestore\Bannerslider\Model\SliderFactory $sliderFactory,
        SliderModel $slider,
        array $data = []
    ) {

Why php could accept this changes? Couldn't it crash the method call as the number of arguments are not the same?


texts:
Have been trying to setup magento for 2 days, but stuck because of the PHP version.

What I have tried

Changed php version in cpanel which generates a php.ini file in public_html, but install fails because it requires an empty folder
Ran composer command with --ignore-platform-reqs, but it ends up generating an errors:

  Warning: Unsupported declare 'strict_types' in
  path/vendor/magento/inventory-composer-installer/src/Plugin.php on
  line 6

  Parse error: syntax error, unexpected ':', expecting ';' or '{' in
  path/vendor/magento/inventory-composer-installer/src/Plugin.php on
  line 55

Tried specifying the php version in composer.json, but in the end it returns same 2 errors above

I can't change the default PHP or install PHP 7.1 package using "Remi's RPM repository", due to insufficient privileges, but I do have the right PHP version in /usr/local/bin/php but can't force composer to use it unfortunately.

If there was a way to have it run without forcing the folder to be empty, but it doesn't seem like that's possible.

By far the hardest install of an app I've ever come across :(


texts: Upload 1500 products in 1.13, but it we need to click save on every one to go live

texts: Would very much like you help. We are uploading 1500 products and the content and images are all in properly. However to get them to show up in frontend, we have to hit save on very product then reindex. Any way to do this once?


texts: Is there a way of removing "reorder" option from Magento 1.9 by changing configuration?

texts:
Like in title, is there a way of removing "reorder" option from Magento ver. 1.9 in the configuration section?

I know I can remove it using XML.


texts: Magento 2 : what is difference between js Merge and Bundling

texts: What kind of difference between js Merge and js Bundling for speed optimization.


texts: The page isn’t redirecting properly backoffice magento fresh installation Version 2.1.16

texts:
Fresh installation of magento 2.1.16, throwing error admin url

This page isn’t working

XXX.XXX.com redirected you too many times.

Try clearing your cookies.
ERR_TOO_MANY_REDIRECTS


texts: Magento : Zero Grandtotal Paypal Checkout Issue

texts:
I used Magento1.9.2.4, When I add product and apply promo code and also spend reward points that will made my grandtotal amount $0, and on checkout I select paypal.
The issue is that paypal not accept $0 grandtotal checkout.

Kindly Suggest how can I fix this?


texts:
Im trying to make product in specified category to have an overlay on its image, ex. "NEW/FRESH" on image.

I can handle image change, but I have no idea how/where I can in-time change product image...

Only solutions I found were including configurable products, which I don't want/need.

Some hints?


texts: getting no shipping and payment method in cart and checkout page

texts:
I am getting error on console in magento 2.3 on cart and checkout page, by which i cannot see any shipping and payment method

I upgraded magento from 2.2.1 to 2.3.3 before its working fine after upgrading its giving me issue

Error on console

jquery-2.2.2.min.js:4 GET http://www.testing.projectblitz.com/m232/checkout/undefinedcustomer/section/load?sections=cart&force_new_section_timestamp=false&_=1579163223222 404 (Not Found)

customer-data.js:95 Uncaught Error: [object Object]
    at Object.<anonymous> (customer-data.js:95)

jquery-2.2.2.min.js:4 POST http://www.testing.projectblitz.com/m232/checkout/undefinedrest/default/V1/carts/mine/estimate-shipping-methods 404 (Not Found)
jquery-2.2.2.min.js:4 POST http://www.testing.projectblitz.com/m232/checkout/undefinedrest/default/V1/carts/mine/totals-information 404 (Not Found)

Screenshot:  https://www.screencast.com/t/SnBYDVJ4

But its working fine on luma theme, its something issue with my custom theme, how can i debug this or correct this.

I am also cannot see items on my mini cart


texts:
i have looked everywhere i can think of and cant figure out how to change the wording of the labels in the progress checkout for multishipping.

where are the <?php foreach ($this->getSteps() as $_step): ?>
steps defined?


texts: Magento 1.9 Continue Button not moving to next section in onepage checkout page

texts:
Am using magento 1.9.3 am trying to add new steps after shipping method called DELIVERY INSTRUCTIONS i refer this link [ https://www.fontis.com.au/blog/adding-step-onepage-checkout].

I did everything same in that link.

But DELIVERY INSTRUCTIONS Continue button not moving to newt step. Showing some error in console like this

This my deliveryinstructions.phtml code

<form id="co-deliveryinstructions-form" action="">

        <?php echo $this->getChildHtml('additional') ?>

&laquo; <?php echo $this->__('Back') ?>

        <button type="button" class="button" onclick="deliveryinstructionsMethod.save()"><?php echo $this->__('Continue') ?></button>

            <img src="<?php echo $this->getSkinUrl('images/opc-ajax-loader.gif') ?>" alt="<?php echo Mage::helper('core')->quoteEscape($this->__('Loading next step...')) ?>" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Loading next step...')) ?>" class="v-middle" /> <?php echo $this->__('Loading next step...') ?>

</form>

And my second questions

Add progress title in YOUR CHECKOUT PROGRESS

Skin\frontend\base\default\js\opcheckout.js

setShippingMethod: function() {
        //this.nextStep();
        this.gotoSection('deliveryinstructions', true);
        //this.accordion.openNextSection(true);
    },

    //code added
    setDeliveryinstructions: function() {
        //this.nextStep();
        this.gotoSection('payment', true);
        //this.accordion.openNextSection(true);
    },
    //code added

How can i fix this two errors...?

Thanks in advance


texts:
I know it is possible to remove system attributes, changing them to user defined ( database table eav_attribute column “is_user_defined” ).

I wonder if this is safe ? ( for example could it be a problem for future Magento Upgrades ? )


texts: Collection filtering with OR and inner AND

texts:
can somebody tell what is the best way to filter a collection like this:

where email='john.doe@gmail.com' OR (firstname='John' AND lastname='Doe' and city='Boston')

I got a working version with this code:

$orderCollection = Mage::getModel('sales/order')->getCollection();
$orderCollection->join(
    array(
        'order_address' =>'sales/order_address'),
        'order_address.parent_id=main_table.entity_id AND order_address.address_type="billing"',
        array('firstname','lastname','city')
     )
;
$orderCollection->addFieldToSearchFilter('customer_email', array('EQ'=>'john.doe@gmail.com'));
$orderCollection->addFieldToSearchFilter('customer_firstname', 'John');
$orderCollection->addAttributeToFilter('customer_lastname', 'Doe');
$orderCollection->addAttributeToFilter('city', 'Boston');

The SQL Statement is correct:

SELECT `main_table`.*, `order_address`.`firstname`, `order_address`.`lastname`, `order_address`.`city`
FROM `sales_flat_order` AS `main_table`
INNER JOIN `sales_flat_order_address` AS `order_address` ON order_address.parent_id=main_table.entity_id AND order_address.address_type="billing"
WHERE (((customer_email = 'john.doe@gmail.com'))) OR (customer_firstname = 'John') AND (customer_lastname = 'Dow') AND (`order_address`.city = 'Boston')

I think this solution is not good because it depends on the order of the terms and the rule "AND before OR". I would like to know a solution, that explicitly sets the correct parenthesis like this:

WHERE (customer_email = 'sascha.wohlgemuth@gmail.com') OR ((customer_firstname = 'Sascha') AND (customer_lastname = 'Wohlgemuth') AND (city = 'Berlin'))

Am I pedantic here? Does it even matter? I think of sitations where you can't have a correct order of terms and really need to set the parenthesis the right way.
What do you think?


texts: Magento 2 set order extension attributes via API

texts:
Is it possible to set an order's extension attribute value when creating the order via the API or is there an appropriate API endpoint to update an existing order with this information?

For example to create an order I'm calling /rest/V1/carts/49/order
with the following payload:

{
    "paymentMethod": {
                "method": "banktransfer"
     },
    "billing_address": {
                "email": "jdoe@example.com",
            "region": "New York",
            "region_id": 43,
            "region_code": "NY",
                "country_id": "US",
                "street": ["123 Oak Ave"],
                "postcode": "10577",
                "city": "Purchase",
                "telephone": "512-555-1111",
                "firstname": "Jane",
                "lastname": "Doe"
     },
     "extension_attributes": {
        "legacy_order_id": {
            "value": "1111-1111-1111"
        }
    }
}

But that doesn't appear to get set against the orders extension attribute


texts:
I added a date type column in a custom grid.

$this->addColumn('some_date', array(
    'header'=> Mage::helper('helper_alias')->__('Some Date'),
    'index' => 'some_date',
    'type'=> 'date',
));

Now, when I try to filter my grid by that value and click on the calendar icon I get a js error.

  TypeError: $(...) is null

The line that is causing this is

var index = $("widget-chooser").getStyle("zIndex");

because $("widget-chooser") is null.

If I change the column type to datetime the error does not appear. (but I don't want datetime I want date).

The problem reproduces in the core grids (Shopping cart promo rules for example).

Is there anyway to avoid this?


texts:
ERROR 1227 (42000) at line 999: Access denied; you need (at least one
  of) the SUPER privilege(s) for this operation

I want to restore a production DB to a DEV server, I don't have access to root


texts: How to add content to newsletter/manage/ page from XML in Magento 1

texts:
I want to add the newsletter sign up(image) from default magento footer into newsletter/manage/ page which now it's empty.

Does anyone know how can i add this via XML? Or where i can find the XML responsabile for this page?


texts: Set default value for Checkout Shipping Field

texts:
I want to set a default value for all the fields in the checkout shipping field. So I want to put N/A to all the field in the checkout shipping field also I want to add a class to all those field that has a N/A value. How can I do this?

The main idea here is if the number of orders are below 10 only then I will be placing n/a to all the shipping field in the checkout page and also hide this field that includes the address, zip and country so basically I just want to leave the Email to be displayed but for the rest of the field I will be hiding those field with default value.

So if the order is below 10 then I want to only display the email field like so

But if the order is above 10 I want to display all the shipping field like so

How do I do this? So eventhough these field is not being displayed I'm still setting a default value of n/a for these fields


texts: Not showing messages at onestepcheckout in magento 2.2.x

texts:
After the ajax process get the error from the payment api i can see that the Magento_Ui/js/model/messages.js it triggered and the message should be added to the list but I cant see anything in the front end.

I can see also that the content of the message it is at type.push(messageObj.message);

        /**
     * Add  message to list.
     * @param {Object} messageObj
     * @param {Object} type
     * @returns {Boolean}
     */
    add: function (messageObj, type) {
        var expr = /([%])\w+/g,
            message;

        if (!messageObj.hasOwnProperty('parameters')) {
            this.clear();
            type.push(messageObj.message);

            return true;
        }
        message = messageObj.message.replace(expr, function (varName) {
            varName = varName.substr(1);

            if (messageObj.parameters.hasOwnProperty(varName)) {
                return messageObj.parameters[varName];
            }

            return messageObj.parameters.shift();
        });
        this.clear();
        this.errorMessages.push(message);

        return true;
    },

I tried with the blank template but still the same issue

----------------- UPDATE --------------------

The messages work fine if it if there is a product with shipment and the actual message shows in the payment method area as they should but in the case of virtual products with out shipping that that it is my need they stop showing.


texts: How can I decrypt an encrypted configuration value?

texts:
protected $_paymentData;
protected $_scopeConfig;
protected $logger;

public function __construct(
    \Magento\Framework\Model\Context $context,
    \Magento\Framework\Registry $registry,
    \Magento\Framework\Api\ExtensionAttributesFactory $extensionFactory,
    \Magento\Framework\Api\AttributeValueFactory $customAttributeFactory,
    \Magento\Payment\Helper\Data $paymentData,
    \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig,
    \Magento\Payment\Model\Method\Logger $logger,
    \Magento\Framework\Module\ModuleListInterface $moduleList,
    \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate,
    \Magento\Directory\Model\CountryFactory $countryFactory,
    \Stripe\Stripe $stripe,
    \Inchoo\Stripe\Model\StripeFactory $stripeFactory,
    array $data = array()
) {
    parent::__construct(
        $context,
        $registry,
        $extensionFactory,
        $customAttributeFactory,
        $paymentData,
        $scopeConfig,
        $logger,
        $moduleList,
        $localeDate,
        null,
        null,
        $data
    );
    $this->_scopeConfig = $scopeConfig;
    $this->logger = $logger;
    $this->initializeData($data);
}
 public function getPaymentKey(){
   $key= $this->_scopeConfig->getValue('payment/webpay/keyid');
    echo $key;
    exit;
}

Echo Result : idfrk3-45pfnrkhwneirgplbmisniepssnie:hirtw45
True Key - 'p92GBhcQl7TklHOsWcxBk4eOmL6wpQWBG9nT2Qcf'


texts: Link more categories/sub-categories to 1

texts:
For sure someone asked it before, but i don't know how to call it. So, that's why i asking it again.

In my menu i have different categories like:
Women
Men
accessory

And in the categories there are sub-categories in Women like accessory. Is there a possible way that the accesory can be the same page? So it links to each other?

Hope you can help me guys!


texts: Magento 2.4 dev.docs: about recommended Elasticsearch configurations

texts:
There are two different recommendations/examples:

"The Magento application and Elasticsearch are installed on different hosts (Running on separate hosts is secure, enables Elasticsearch to be scaled, and is necessary for proxying to work)": https://devdocs.magento.com/guides/v2.4/install-gde/prereq/elasticsearch.html
"Elasticsearch runs on the same host as a web server (The advantage of putting Elasticsearch and the web server on the same host is that it makes intercepting encrypted communication impossible): https://devdocs.magento.com/guides/v2.4/install-gde/prereq/es-config-nginx.html (also analogical topic with last one: https://devdocs.magento.com/guides/v2.4/install-gde/prereq/es-config-apache.html)
So, what it mean - here no direct recommendations about same or different hosts or machines? Or what, when and how to choose?
I'm now on my own machine (PC) with one OS, Apache+Nginx (or may be only Apache).
And what should be correct configuration or most effective way for production mode in future? Or it is can stay same rules for both stages (and for developer mode)?


texts:
This is my website (www.4happydays.com)

yesterday till noon it was working properly. but after that i got this error...

Error in file: "/home/happydays/public_html/app/code/core/Mage/Core/sql/core_setup/install-1.6.0.0.php" - SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'core_resource' already exists

Trace:
#0 /home/happydays/public_html/app/code/core/Mage/Core/Model/Resource/Setup.php(645): Mage::exception('Mage_Core', 'Error in file: ...')
#1 /home/happydays/public_html/app/code/core/Mage/Core/Model/Resource/Setup.php(421): Mage_Core_Model_Resource_Setup->_modifyResourceDb('install', '', '1.6.0.4')
#2 /home/happydays/public_html/app/code/core/Mage/Core/Model/Resource/Setup.php(327): Mage_Core_Model_Resource_Setup->_installResourceDb('1.6.0.4')
#3 /home/happydays/public_html/app/code/core/Mage/Core/Model/Resource/Setup.php(235): Mage_Core_Model_Resource_Setup->applyUpdates()
#4 /home/happydays/public_html/app/code/core/Mage/Core/Model/App.php(417): Mage_Core_Model_Resource_Setup::applyAllUpdates()
#5 /home/happydays/public_html/app/code/core/Mage/Core/Model/App.php(343): Mage_Core_Model_App->_initModules()
#6 /home/happydays/public_html/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#7 /home/happydays/public_html/index.php(87): Mage::run('', 'store')
#8 {main}

this is the second time i am getting this error last time i uploaded the backup i had earlier,but i am facing this problem again and again..
This time i lost all my tables from the database... please tell me what would be the possible cause for this.. is there anything in the template i have used... ??


texts: Magento 2: Shipping rates Not Change on Country Change

texts: When I go to my checkout page and change country it's not reflecting my shipping rates.but on the cart page it's working how I debug this issue which files I need to check in magento2.


texts: Magento 2.3 how to get attribute options label by value in block

texts:
I am getting attribute values of an attribute color as 5567, 5568, 5569 etc in block of my custom module.

I want to get the attribute color instead of values as red, blue.

I am getting values as below -

$productCollection = $this->getProductCollection();
    foreach ($productCollection as $product) {

        $colrValue = $product->getColor();

}

Please help.


texts: Magento Promotions -> Conditions Attributes empty

texts:
I am looking after a Magento installation running 1.9.2.2. Under Promotions > Catalogue Price Rule conditions there is no pre-filled conditions such as SKU. How do I fix this? I am following video https://www.youtube.com/watch?v=H83fFszyhrU

What it is:


texts: Cannot extend helper of third party module

texts:
My config.xml:

<?xml version="1.0"?>
<config>
    <modules>
        <Company_Mailchimpextend>
            <version>0.1.0</version>
        </Company_Mailchimpextend>
    </modules>
    <global>
        <helpers>
            <monkey><!-- tried MageMonkey, magemonkey etc. -->
                <rewrite>
                    <data>Company_Mailchimpextend_Helper_Data</data>
                </rewrite>
            </monkey>
        </helpers>
    </global>
</config>

etc/modules/Company_Mailchimpextend.xml:

<?xml version="1.0"?>
<config>
    <modules>
        <Company_Mailchimpextend>
            <active>true</active>
            <codePool>local</codePool>
                <depends>
                <Ebizmarts_MageMonkey/>
            </depends>
        </Company_Mailchimpextend>
    </modules>
</config>

Helper/Data.php:

<?php
    class Company_Mailchimpextend_Helper_Data extends Ebizmarts_MageMonkey_Helper_Data {

        private function _setMaps($maps,$customer,$merge_vars, $websiteId)
        {
            Mage::log("test",null,"test.log");

Third party config.xml:

<helpers>
        <monkey>
            <class>Ebizmarts_MageMonkey_Helper</class>
        </monkey>
    </helpers>

It doesn't seem to be extended somewhere else. Cleared cache, the module is showing in config > advance. It still uses the method _setMaps from the third party module.

Thanks!


texts: Magento 2 - PayPal no choice for different billing & shipping address

texts:
somehow Paypal acts strange. When checking out for our clients on Magento 2.3.X, they cannot chose different billing and shipping adresses. For all other payment methods that works.

See here. For Klarna, choice is given:

For PayPal somehow not:

Does anyone have an idead, how I can show the chechbox "My billing and shipping address are the same" also for PayPal?

Regards & thanks in advance


texts: How to configure multi-currency for single store in magento2?

texts: I have multi-selected the allowed currency option in Store->Configuration->Currency Setup for single store but that currency drop-down option is not coming in front-end.


texts: Magento 2: How to create popup alert in magento 2

texts:
I added a button in block which hits custom controller (I am not using any template)
This is controller code:
<?php
namespace Vtn\UnexportedOrder\Controller\Adminhtml\Order;

use Magento\Framework\Controller\ResultFactory;

class Export extends \Magento\Backend\App\Action
{
    const ADMIN_RESOURCE = 'Vtn_UnexportedOrder::export';

    /**
     * @var \Magento\Framework\View\Result\PageFactory
     */
    protected $_pageFactory;

    /**
     * @param \Magento\Backend\App\Action\Context $context
     */
    public function __construct(
       \Magento\Sales\Api\OrderItemRepositoryInterface $orderRepo,
       \Magento\Backend\App\Action\Context $context,
       \Magento\Framework\Json\Helper\Data $jsonHelper,
       \Magento\Framework\View\Result\PageFactory $pageFactory
    )
    {
        $this->jsonHelper = $jsonHelper;
        $this->orderRepo = $orderRepo;
        $this->_pageFactory = $pageFactory;
        return parent::__construct($context);
    }

    /**
     * Index action
     *
     * @return \Magento\Framework\View\Result\Page
     */
    public function execute()
    {
        $itemId = $this->getRequest()->getParam('itemid');
        $item = $this->orderRepo->get($itemId);

        if ($this->getRequest()->getParam('itemid')):
            $itemId = $this->getRequest()->getParam('itemid');
            $item = $this->orderRepo->get($itemId);
            $data = $item->getName()." is already exported";
            $resultJson = $this->resultFactory->create(ResultFactory::TYPE_JSON);
            $resultJson->setData($data);
            return $resultJson;
        endif;
    }
}

For now it displays products name on controller url (frontname/controller/export).
But I want to display it on same controller where button exists using ajax call and display this product name in popup on this controller url (frontname/controller/view)


texts: Created Custom Product Attribute but Not showing in Configuration Section in magento 2

texts:
attributes are not shown under this area ,

Step 2: Attribute Values
Select values from each attribute to include in this product. Each unique combination of values creates a unique product SKU.


texts: Making a purchase without Shipping or Payment. Follow up Invoice with actual shipping costs

texts:
We have a client that we've set up a store for B2B sales to their wholesale customers. Since they have a specific customer list that they allow to make purchases on their site, they would like to invoice them for the purchase for them to make payment offline (send a check, etc). So basically a Purchase Order. No CC needed. Complete order and then they'll invoice them.

But they also will be freight shipping since most things are large packages. They don't want to try and calculate shipping real-time at this time, but rather follow up with the customer with their final Invoice that includes the ACTUAL shipping charge once they ship out.

So... I'm trying to figure out the best way to:

Allow the customer to not have a shipping charge as part of their steps on checkout. Right now, I have Free Shipping, but renamed it to basically explain that Shipping will be calculated with the final invoice sent with products.
Allow the customer to not have to use a credit card as part of the steps during checkout. Right now, I have it as a Check/Money Order (mainly because Purchase Order doesn't seem to work... doesn't go to the next step). Same thing here, I update the text of the Check payment method to state "we'll send you a final invoice or charge any card we have on file for your account."
IN the Admin, would like to be able to modify/add a charge for the final shipping fees, along with providing the tracking info, so the customer gets an email follow up when they ship the order, and can see their final invoice to be paid.
THIS, I'm not sure how to accomplish.

Items 1 and 2 sort of work, but shows the modified text on emails/invoices. Maybe there's a better way, like bypass the payment and shipping steps altogether, and the text is just displayed somewhere statically on the checkout page.

How would you try to accomplish this?


texts: how to set no tax for wholesaler customer group in Magento 2?

texts:
If a customer belongs to wholesaler group then tax should not be applied to that customer. Can Anyone help me how can I do this in Magento 2?

Any help will be appreciated.
Thanks.


texts:
I'm implementing custom API for Magento 2. My client want the response to be as associative array.
Here is my class method:

class Gcapiapi implements GcapiapiInterface
{
     /**
       * Returns greeting message to user
       *
       * @param string[] $products
       * @return array
       */

       public function list($products  = NULL)
       {
          $result = array();
          $stockItems = ...
          ...
          foreach($stockItems as $stockItem){
             $itemData = array('product_id' => $product->getId(), 'sku' => $productSku, 'qty' => $stockItem->getQty(), 'is_in_stock' => $stockItem->getIsInStock());
             $result[] = $itemData;
          }
          return $result;
       }
}

Here is interface declaration:

interface GcapiapiInterface
{
   /**
   * Returns greeting message to user
   *
   * @param string[] $products
   * @return array
   */
    public function list($products = NULL);

}

I've added logs and I see that my method list executing. But in response I'm getting 500 error.
In exception.log I see the error:

Message: Class "array" does not exist. Please note that namespace must be specified.

I want to get the following response:

array (size=2)
0 =>
array (size=4)
  'product_id' => string '3708' (length=4)
  'sku' => string 'W3L2221LDCB2' (length=12)
  'qty' => string '228.0000' (length=8)
  'is_in_stock' => string '1' (length=1)
1 =>
array (size=4)
  'product_id' => string '3709' (length=4)
  'sku' => string 'W7L1226E5C96' (length=12)
  'qty' => string '23.0000' (length=7)
  'is_in_stock' => string '1' (length=1)

Can I get SOAP response as associative array somehow?
Thanks,


texts: Product Attributes could not be reindexed

texts:
I am recieving this error while trying to reindex "Product Attributes". Can anyone suggest, what might be the issue and possible solution

  Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '2828-148-1-471' for key 'PRIMARY'' in E:\xampp\htdocs\magento\lib\Zend\Db\Statement\Pdo.php:228 Stack trace: #0 E:\xampp\htdocs\magento\lib\Zend\Db\Statement\Pdo.php(228): PDOStatement->execute(Array) #1 E:\xampp\htdocs\magento\lib\Varien\Db\Statement\Pdo\Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array) #2 E:\xampp\htdocs\magento\app\code\core\Zend\Db\Statement.php(291): Varien_Db_Statement_Pdo_Mysql->_execute(Array) #3 E:\xampp\htdocs\magento\lib\Zend\Db\Adapter\Abstract.php(480): Zend_Db_Statement->execute(Array) #4 E:\xampp\htdocs\magento\lib\Zend\Db\Adapter\Pdo\Abstract.php(238): Zend_Db_Adapter_Abstract->query('INSERT INTO ca...', Array) #5 E:\xampp\htdocs\magento\lib\Varien\Db\Adapter\Pdo\Mysql.php(428): Zend_Db_Adapter_Pdo_Abstract->query('INSERT INTOca...', Array) #6 E:\xampp\htdocs\magento\lib\Varien\Db\Adapter\Pdo\Mysql.php(1998): Varien_Db_Adapter_Pdo_Mysql in E:\xampp\htdocs\magento\lib\Zend\Db\Statement\Pdo.php on line 234


texts: Looking for the "missing link" in IE cookie/session issue

texts:
Magento 1.9.0.1 CE on LAMP

Experiencing an issue with the customer login page on our website. Users of IE7 - IE11 only are experiencing a redirect loop - the page refreshes without error message of any sort after typing in credentials and clicking "login". I'm not seeing any Javascript or server errors related to it. My server access log seems to be showing the same login URLs as when Chrome and Safari try to use customer login. The real problem I feel is happening is in how my site issues session or cookies. I'm 99% certain that it is relevant to that and not related to any other common problem like "form key".

Here are my cookie settings:

Cookie Lifetime: 86400
Cookie Path: /
Cooke Domain: .mydomain.com
Use HTTP Only: No
Cookie Restriction Mode: No

"mydomain" is actually replaced with our actual domain on the site.

Could any of these settings be affecting IE?


texts:
After upgrading Magento from 2.1 to 2.2 I got a weird issue. Site is showing all pages blank on frontend, but admin panel has error "not redirecting properly" and can not be accessed. No errors in logs.

Mode: production; Magento version: 2.2.3 Commerce


texts: is there extension to know if the invoice has been printed or not?

texts:
I am using Magento 1 and I am looking for an extension to tell me whether an invoice has been printed or not. For avoid order duplicated or missing to print.

thanks


texts: Magento 2 Get Product Url For Specific Store

texts:
I have multi stores enabled in my Magento instance. I am trying to get product url for each store as I need to index data in Elasticsearch.

What I have tried but not getting the result with store appended in url.

$productId = 2;
$storeId = 4;
$product = $this->productRepository->getById($productId, false, $storeId);
$product->setStoreId($storeId)->getUrlModel()->getUrlInStore($product, ['_escape' => true]);

I expect result as

http://example.com/mystorecode/product1.html

Where as I get the result

http://example.com/product1.html


texts: Best practice to display manufacturer/brand/attribute several places

texts:
So I know how I just don't know if my method is the best practice/"easy" way to do it.

The places I plan to show brand/manufacturer name is: (always after product name)

mini-cart
checkout/cart
product page
wishlist
product grid
order email (items.phtml)
related products
upsell
new.phtml

What I'm using now:

product/view.phtml:

<? echo $_product->getAttributeText('manufacturer') ?>

template/checkout/cart/item/default.phtml (example: showing product name aswell here)

<a href="<?php echo $this->getProductUrl() ?>"><?php echo $this->htmlEscape($this->getProductName()) ?>

<?php $_product = Mage::getModel('catalog/product')->load($_item->getProductId());
$manufacturerName = $_product->getAttributeText('manufacturer') ; ?>
<?php echo $manufacturerName; ?>

Any ideas?


texts: How can Save API respond (For each order request - PDF file) with order id in database?

texts: I create event with observer and execute it . In execute function I get API respond (PDF file) for each order request . How can save this pdf link with order id in table I create it (Install schema) ?


texts: I have a Magento 1.9.0.1 running for a year and it's a little bit slow when returning products, since they are a lot. I read about the flat catalog category and flat catalog product options and i want to enable them now. Is it safe to do it now and do i need to do anything else apart from clearing the caches?


texts: In Magento 2 Product Update via Import CSV file

texts:
Need to update the product data via CSV file through import action.

I am facing an issue to display the bundle product in front-end of the website after updating the product via import action.

  Here are the steps which I have followed:

  Creating a new product (simple product and bundle product) in the admin panel
  Go to System -> Data Transfer -> Export and export it.
  Open the exported CSV file and update/change the price or any attribute value in it
  Now, go to Sytem -> Data Transfer -> Import and Imported Successfully.
  The Products are not showing in front end

  Current result:  The product page showing as "404 error message Page not found"


texts:
Url ex: http://magentotest.dev/checkout

This is my problems:

How can I fix it?


texts: Magento 2.3 after installation problem with intl

texts:
I have a problem with Magento 2.3.5 After installation when i go to magento i see error 500. In my error log is
[Mon Sep 28 10:02:41.724732 2020] [php7:error] [pid 29850] [client 89.64.6.204:49120] PHP Fatal error:  Class 'IntlDateFormatter' not found in /public_html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php on line 121

I have installed INTL for php
/etc/php.d/20-intl.ini,
intl
intl.default_locale => no value => no value
intl.error_level => 0 => 0
intl.use_exceptions => 0 => 0

My PHP version:
PHP 7.3.22 (cli) (built: Sep  1 2020 09:44:58) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.22, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.3.22, Copyright (c) 1999-2018, by Zend Technologies

Do you have any idea why it does not work?


texts: Magento 1.9.3 Get Shipping Address From Observer With Event sales_order_place_after

texts:
I have a custom function that is triggered with event sales_order_place_after, I need to retrieve the shipping address in this function.

I tried $observer->getCustomerAddress(), but it didn't work. How could I get the shipping address?

This is my function

        public function SalesOrderPlaceAfter($observer)
        {

            $orderIds = $observer->getEvent()->getOrder()->getId();
                if (!empty($orderIds))
                {
//This get me the shipping method. it's working.
    $shipping_method = $observer->getEvent()->getOrder()->getShippingMethod();

// this is not working, How can I get the shipping address?
    $shipping_address = $observer->getEvent()->getOrder()->getShippingAddress();
                }
        }


texts:
I have to update some sales order parameters

$order = $this->orderInterface->loadByIncrementId('000000009');
 $order->setStatus($status)
       ->setState($status)
       ->save();

Here save() is @deprecated and also if try to save, it does not save.

I tried:

/**
*  @var OrderStatusApiInterface
*/
$this->orderRepositoryInterface->save($order);

It changes all the other data also is completely false.


texts:
I would like to change the name a plugin in order to have a translated to my language URL

www.example.com/newname instead of www.example.com/oldname

Is there any tutorial to find how to do this? Do I have to change the folder name in app and skin, besides the xml files and the IndexController.php?

Am I missing something?


texts:
Can any one tell me how to magento 1 website indexable by google.
Any help?


texts: My Account reorder link onclick Ajax call controller in magento 2.4

texts:
My Account reorder link onclick Ajax call controller in magento 2.3

app/code/Vendorname/Modulename/view/frontend/templates/order/history.phtml

 <?php if ($this->helper(\Magento\Sales\Helper\Reorder::class)->canReorder($_order->getEntityId())) : ?>
            <a href="#" data-post='<?= /* @noEscape */
            $this->helper(\Magento\Framework\Data\Helper\PostHelper::class)
            ->getPostData($block->getReorderUrl($_order))
            ?>' class="action order">
            <?= $block->escapeHtml(__('Reorder')) ?>

 <?php endif ?>


texts: Magento 2.4 How to activate the auto refresh for orders, so when customer place order directly it appear in the orders grid with out manual refresh?

texts: How to activate the auto refresh for orders, so when customer place order directly it appear in the orders grid (Order management - Admin backend) with out manual refresh?


texts: Add column in observer for controller_action_postdispatch_adminhtml_permissions_user_roleGrid

texts: I've created observer for  controller_action_postdispatch_adminhtml_permissions_user_roleGrid event, that is called on AJAX when filtering permission user grid. Problem is that I can't add custom column (with renderer) - how to get grid object from Varien_Event_Observer $observer?


texts: controller action name of module is displaying in frontend

texts:
I am trying to find controller action of module for below Observer code, so that i can see those action names in log file : called_action_names.log ,  its displaying those names in log files.

issue :  along with this its displaying those names in site & now its not saving the uploaded image in site once we click on "save design" button.

you can see text catalog_product_view in top of the page

public function onControllerActionPredispatch($observer)
    {
      Mage::log($observer->getEvent()->getControllerAction()->getFullActionName(), Zend_Log::DEBUG, 'called_action_names.log');
        if (
            $observer->getEvent()->getControllerAction()->getFullActionName() == 'example_amasty_createProduct' &&
            !Mage::getSingleton('customer/session')->isLoggedIn()
        ) {
            Mage::getSingleton('customer/session')->setAmastyExampleCustomProductInfo(
                $observer->getEvent()->getControllerAction()
                    ->getRequest()->getPost('Amasty')
            );
        }
        else if (
            Mage::getSingleton('customer/session')->isLoggedIn() &&
            Mage::getSingleton('customer/session')->getAmastyExampleCustomProductInfo()
        ) {

        }

     echo $observer->getEvent()->getControllerAction()->getFullActionName();
    }

   }

config.xml

<controller_action_predispatch>
            <observers>
                <Amasty_Example>
                    <class>example/observer</class>
                    <method>onControllerActionPredispatch</method>
                </Amasty_Example>
            </observers>
</controller_action_predispatch>

when i replace line : <class>example/observer</class> by <class>my_module/observer</class> , it dont show any issue. but real module name is "example".


texts:
I'm using Magento 2.1.0. I have configured the multi-website, multi-store,  multi-store-view. Referred this link and this link.

Steps I did:

I have configured in the backend.

Created new-folder in the root.

Copied index.php and .htaccess files to the new-folder.

When accessed my new site like http://example.com/mystore2, it is not working.

How to solve this.


texts:
I have a multi-select product attribute and i am wanting to exclude several values from a collection.

i.e

attribute = filter_theme
possible values = A, B, C, D, E, F, G, H

If i use nin like so:

$collection->addAttributeToFilter('filter_theme', array('nin' => $exclude));

It will only work if the products only have a single selection on filter_theme i.e value A

If they have more than one it won't work i.e values A & B. (I know this is also the case when using in to find rather than exclude)

Again i know that i can use finset to find any products with $exclude, whether it has 1 or all options selected:

$collection->addAttributeToFilter('filter_theme', array('finset' => $exclude));

This will work on both value A only and value A & B & Cbeing selected.

Is there a way of doing the opposite of finset to exclude rather than include so that it works no matter how many values are selected for my attribute?


texts: Magento 2.2.5 After Upgrade To 2.3 CLI commands don't work

texts:
I upgraded magento version by documentation, after upgrade this happens:

When running php bin/magento cache:flush or any other bin/magento command error appears
 There are no commands defined in the " " namespace
When running php bin/magento list these errors appear:

In ServiceManager.php line 1130:

An abstract factory could not create an instance of magentosetupconsolecommanddbstatuscommand(alias: Magento\Setup\Console\Command\DbStatusCommand).

In ServiceManager.php line 941:

An exception was raised while creating "Magento\Setup\Console\Command\DbStatusCommand"; no instance returned

In ClassReader.php line 19:

Class Magento\Framework\Setup\Declaration\Schema\FileSystem\XmlReader does not exist

There are no missing module.xml in any custom modules.
UPDATE:

few modules module.xml had this:

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd">

instead it should be this:

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">

UPDATE2: same error still persists.
Tried

rm -rf var/cache/* var/page_cache/* var/di/* var/generation/* var/view_preprocessed/*

and composer update  above fix didn not help still.


texts: Share the product information for two different views

texts:
I want to use for 2 different store views the same language.

Is possible make it without copy the same information in the two storeviews?

I want to share the information of a store view for two.


texts: How to use HTTPS with varnish or a fast way (Struggling) - Magento 2.1

texts:
We've been trying to get our Magento platform to work FULL with HTTPS, however, varnish doesn't work with HTTPS and then the site gets really slow... normally a page loads in 1s to 3s with https is taking about 13s.

We tried to use Nginx for HTTPS and Varnish for http, following the instructions on this link:
https://www.smashingmagazine.com/2015/09/https-everywhere-with-nginx-varnish-apache/

But the site doesn't load properly, the links (js, css...) in Magento tries to load in HTTP or the site gets into a loop forever.

Any ideas or suggestions would be very appreciated.

Thanks


texts:
How can I update whole block product.info from ajax controller?

 public function indexAction(){
    $prod_id  = (int) $this->getRequest()->getParam('simpleProductId');
    $product = Mage::getModel('catalog/product')->load($prod_id);

    $result = array(
        "sku" =>$product->getData('sku'),
        "name" => $product->getName(),
        "shortDescr" => "desc",
        "delivery" => "delivery",
        "price" => "price"
    );

    echo json_encode($result);
}

For now, I'm updating single parts of it, but how update whole block?


texts: How to remove SKU column from order details in My account page

texts:
I wish to remove SKU from order details.

Open my account page in frontend
2.Go to My Orders
3.Click View Orders link from the list of orders

How to remove the SKU colum and its associated details.

Please provid eme a solution


texts:
Is it possible to group and/or together when creating a product collection

I have 2 attributes size and color.

I want to find products that have the following:

Size = 10 and Color = red
or
Size = 12 and Color = blue
or
Size = 14 and Color = green

It doesnt appear that the addAttributeToFilter method provides the possibility of doing these groups and instead allows only and or or.


texts: Magento2.2 configurable products out of stock issue

texts: I am working on Magento 2.2 I install https://github.com/interjar/configurable-child-visibility module to show Configurable child products visibility when out of stock and its working fine  I want to make the option none clickable if the product is out of stock is there something that is possible with this module. Any suggestion will be highly appreciated.


texts: Ngnix issue caching image with magmi importing

texts:
I have used magmi tool to import product images on Magento 2.0.6.

There is one option is to replace the images if it exists.

I have check that option,
it uploads the file successfully physically (I use transmit to go to the server to check that).

But i view it on the web it still display the old image, not the image i have just imported.

I know it is the cache issue, i have already tried to flush and clear all the cache that i know : redis cache, magento caches.

Are there any caches that i am missing here? (like nginx cache because my local machine using apache and it works fine)


texts: Magento cron job issues newsletters not leaving

texts:
Thank you in advance for any answers here is my magento cron settings in the admin of magento store

Generate Schedules Every 60
 Schedule Ahead for 1
Missed if Not Run Within 60
History Cleanup Every 120
Success History Lifetime 120
 Failure History Lifetime 120

Here is my set up on my server

*/15 * * * * /bin/sh /home/mypath/public_html/cron.sh

Here is what I get when the cron job runs the cron.sh script in a email from my server

Content-type: text/html

If I run cron.php in my browser it returns a empty page

I created a newsletter added it to queue set it for a few minutes later and clicked send newsletter it does not go I checked cron_schedule table in php my admin and it had entries that said pending that were from a month ago I read some where it was safe to delete them so I did (the table structure is still perfect).

Can anyone point me in the right direction it is driving me nuts!

Thank you in advance.


texts: Where does Magento save store view specific product description / short description

texts:
I have located the value for short description for the default store store (catalog_product_entity_text.value) but I can't find my modified 'store view' version.

Could somebody let me know the exact table please.


texts: How to correctly select the first item from a filtered collection?

texts:
I'm trying to write a script to get a category given its path, which seems like it should be easy to do. As a test, I have a base category with an ID of 2, and it has 2 children, 'Foo' and 'Bar'. I'm using this code to try to get the 'Foo' category:

// Get the 'base' category.
$category = Mage::getModel('catalog/category')->load(2);
// Try to filter it out so that I only get 'Foo'
$category = $category->getChildrenCategories()->addFieldToFilter('name', 'Foo');

At this point, calling print_r($category->getData()); shows that it should be doing what I want:

Array
(
    [0] => Array
        (
            [entity_id] => 16
            [entity_type_id] => 3
            [attribute_set_id] => 0
            [parent_id] => 2
            [created_at] => 2016-06-25 22:47:23
            [updated_at] => 2016-06-25 22:47:23
            [path] => 1/2/16
            [position] => 2
            [level] => 2
            [children_count] => 28
            [request_path] =>
            [is_active] => 1
            [name] => Foo
        )

)

There is 1 item in the collection, and it's the one I'm looking for. However, then I do:

$category = $category->getFirstItem();
print_r($category->getData());

I expect it to select the 'Foo' category, but it's selecting the 'Bar' category instead:

Array
(
    [entity_id] => 5
    [entity_type_id] => 3
    [attribute_set_id] => 0
    [parent_id] => 2
    [created_at] => 2016-06-25 22:42:19
    [updated_at] => 2016-06-25 22:42:19
    [path] => 1/2/5
    [position] => 1
    [level] => 2
    [children_count] => 87
    [request_path] =>
    [is_active] => 1
    [name] => Bar
    [url_key] => bar
    [is_anchor] => 1
)

I'm assuming at this point that getFirstItem() just gets the first item in the whole collection and ignores the filters, but I can't seem to find any documentation for it (although it's used in just about every example I've found). This method doesn't seem to exist in the collection class.

Am I missing a step somewhere? Where can I find the documentation for this method?

Update: I forgot to mention, but this is in Magento 1.9


texts: Magento2 add to cart always adds 2 items

texts:
Here is our site test.onepearl.co.uk/sherdley this magento version is 2.1.3 everything was working fine but now today when you click add to cart from the product page it adds 2 of the item to the cart.

Strange thing is it doesn't alway happen but around 80% of the time it goes wrong instead of adding 1× Item it adds 2 x item .

Does anyone know what causes this ?


texts: Magento 2 : How can I call helper function on override block

texts:
I want to show some extra data on product list page so I override the vendor\magento\module-catalog\Block\Product\ListProduct.php.
For this I refer Add custom block on listing page : Magento2. It work.

But I need to call my helper function in my override block file.
Created new file name ListProduct.php in app\code\Vendor\Module_Name\Block\Product:

namespace Vendor\Module_Name\Block\Product;
class ListProduct extends \Magento\Catalog\Block\Product\ListProduct
{

    // I need to call my module helper function here:
    public function test()
    {

    }
}

How can I call my helper function inside this block file?
Thanks


texts: Magento 1. Set customer attribute based on (max) order attribute values

texts:
we want to store some meta/customer attributes dynamically based on order data. Per customer we would like to store the brand attribute that was sold most and store the size attribute that was sold most.

Support a customer has 3 orders with products

Order    Item1                     item2                     item3
12345    Shoe (brand XX, size 41)  Shoe (brand YY, size 41)  Shoe (brand XX, size 43)
45678    Shoe (brand AA, size 41)  Shoe (brand XX, size 41)  Shoe (brand XX, size 43)

So this customer has a preference for: size = 41 and Brand = XX

Now we would like to run a query (or via code) that updates this customer (custom) attributes with size = 41 and Brand = XX -- actually do it for all customers.

Question: Can this be done via a simple query (using max) or magento model with code or extension? Maybe some example already exist.

(fyi. we need thos because we link to external datasources that can only communicate customer attributes)


texts: Magento 2.0.9: - Cannot login to magento admin

texts:
I logged in to magento 2.0.9 admin, enabled the caches , but after sometime when refreshed admin panel is not working. Showing like the below.

How to get into the admin panel ?


texts: Magento 2 - Create a custom index.phtml before entering the site

texts:
i would create a custom index.phtml for my site of magento before entering the site. In this index i would insert the form of registration of customers and after the registration the possibility to enter in the site.

My question is...it's possibile connect the form of registration in my index.phtml with the registration in backend of customers in Magento? If yes, how?

Thank you very much.


texts: Update table use where codition(CRUD) - Magento 2

texts:
I need to update particular field in table using CRUD operation of Magento.

I have tried below for insert new record it is working

$this->_cancelFactory->create()->setData(array('cancel_status'=>'Review'))->save();

I have tried below for update particular row but it does not work

$this->_cancelFactory->create()->setData(array('cancel_status'=>'Canceled'))->where(array('order_id'=>$oid))->save();

What is the right way to update table?