texts: Can someone explain this entry in debug.log file?

texts:
I found this in debug.log file on my Magento ver. 2.1.8 store but don't really understand what it is saying. Can someone explain?

http://lb1.i:80/)"],"tagsPattern":"((^|,)catalog_product_3666(,|$))|((^|,)catalog_category_product_55(,|$))|((^|,)catalog_category_product_65(,|$))|((^|,)catalog_category_product_127(,|$))|((^|,)catalog_product_3668(,|$))"},"is_exception":false} []


texts: Magento 2 - Keep Product Image Aspect Ratio

texts:
I'm working with Magento 2 Category Page.

But I couldn't know how to keep the product image aspect ratios.

In magento 1.x, I can get the image src to use below code.

<?php
    echo $this->helper('catalog/image')
    ->init($_product, 'small_image')
    ->constrainOnly(FALSE)
    ->keepAspectRatio(TRUE)
    ->keepFrame(FALSE)
    ->resize(300);
?>

But in magento 2, I can set the image sizes in /app/design/frontend/Magento/luma/etc/view.xml file.

<image id="category_page_grid" type="small_image">
    <width>240</width>
    <height>300</height>
</image>
<image id="category_page_list" type="small_image">
    <width>240</width>
    <height>300</height>
</image>

I tried to input the height with "auto", but it didn't work.

I also tried to input only width, it didn't work, too.

And I found below code for showing product images in Magento_Catalog/templates/product/list.phtml file.

<?php
    $productImage = $block->getImage($_product, $image);
?>
<a href="<?php echo $_product->getProductUrl() ?>" class="product photo product-item-photo" tabindex="-1">
    <?php echo $productImage->toHtml(); ?>
</a>

Anyone know how to show the product images with keep Image aspect ratios?


texts: How to join Sales order collection and order item collection

texts:
I want to join the sales order collection and sales order item collection

How to join the two collection

I have collections like

order collection

>   $ordercollection=$this->orderCollection->create();

Item collection

>  $orderDatamodel = $this->itemFactory->create()->getCollection()
>             ->addAttributeToFilter('created_at', array('from'=>$fromDate, 'to'=>$toDate));

I want to join these two collections.

How could i join these two?


texts: Outlook email did not receive Magento transaction email

texts: My outlook email have not received any Magento transactional email yet (email order confirmation, new account). Our website using magento version 1.9.3.0. What do I need to configure or set else?


texts: how to structure products to achieve sample purchase

texts:
Can anyone help us?

Our not for profit social enterprise sells reclaimed carpet tiles but we have to sell them in batches of 20 (1box) due to shipping costs, BUT we also want to be able to offer free samples so customers can check that the colour is right for them because it is impossible to get accurate colour rendering on monitors.

The reclaimed carpets come in different conditions and we sort them 'Grades (A-D)' so a particular tile (e.g. Sunset Yellow) might have up to 4 variations of quality A-D.
Currently we just have simple products setup so Sunset Yellow(gradeB) Sunset(gradeA) etc.
Each of these has a minimum qty of 20 and increments of 20 setup so that they have to buy at least 20 and then order in increments of 20.

BUT we are wondering how we might allow ordering of 'sample' pieces of each product.

Perhaps 'sample versions of each product? (e.g. Sunset Yellow(gradeA sample), Sunset Yellow(gradeB sample)available but not with it's own stock qtys in the inventory.
I know we could duplicate every product and have a 'sample' version but this would be an admin nightmare, hoping there is a smarter way to do this.

This would make a really big difference to our store so any help or thoughts would be gratefully received.


texts: Install Magento2 Enterprise on desktop Mac via Docker

texts:
I am trying to install a fresh install of Magento2.3.3 enterprise on my local Mac desktop via docker.I am new to docker so maybe i am missing something.

I installed composer, and also docker.

The error i am getting says

 To initialize a project, please create a composer.json file as described in the
 https://getcomposer.org/ "Getting Started" section
 Could not open input file: /app/bin/magento

 An error has occurred. Removing newly installed files and/or Docker containers.

I tried manually creating a composer.json file and putting the below in it

{
    "require": {
       "magento/product-enterprise-edition": "2.3.3"
    }
 }

I also made sure my yml file has my correct Magento public and private keys. I am using the tutorial here
https://www.magemodule.com/all-things-magento/magento2-freebies/magento2-docker-vm-script/

Also when I run the following command
docker-compose up

I get a error that says
Error: No such object: Websites


texts:
When I click to print an invoice in my magento admin panel, it downloads a file between 900K and 1.3MB (the variation seems random, I can't see a reason for it).  This is a very simple Invoice with maybe 1 - 6 line items on it, so nothing that should make it take up more than 100K or so maximum.

Is there embedded fonts?

Could it be something on the serverside?

Is there a simple tweak I can make to reduce it?

I know with modern broadband etc it doesn't really matter, but it just seems a bit unnecessary.


texts: How to stop Javascript alert box from popping up on each page load?

texts:
I've been trying to create a popup for the Currency Selector on Magento. With some help I finally got this to working but it pops up on each page load.

Maybe someone knowledgeable in javascript can see how to fix it?

Here is the code:

<?php if ($this->getCurrencyCount() > 1): ?>
    <div class="form-currency">
        <select class="dropdown" onchange="window.location.href=this.value" name="currency-selector"
                id="currency-selector">
            <?php foreach ($this->getCurrencies() as $code => $name): ?>
                <option class="label" value="<?php echo $this->getSwitchCurrencyUrl($code) ?>"
                    <?php if ($code == $this->getCurrentCurrencyCode()): ?>
                        selected="selected"
                    <?php endif; ?>>
                    <?php echo $name ?>
                </option>
            <?php endforeach; ?>
        </select>
    </div>
<?php endif; ?>

<script>
    jQuery(document).ready(function () {
        var currency = document.getElementById('currency-selector');
        var showMessage = sessionStorage.showMessage;
        if (showMessage) {
            sweetAlert('<?php echo $this->__('During checkout all charges will be in US dollar') ?>');
            sessionStorage.showMessage = false;
        }
        currency.addEventListener('change', function () {
            sessionStorage.showMessage = true;
            window.location.href = currency.value;
        });
    });
</script>


texts:
New to magento, I'm trying to find where is defined the content of one of my page. But I can't find it

I found the action called before I have my page

/**
 * Forgot customer account information page
 *
 * @return \Magento\Framework\View\Result\Page
 */
public function execute()
{
    /** @var \Magento\Framework\View\Result\Page $resultPage */
    $resultPage = $this->resultPageFactory->create();

    $block = $resultPage->getLayout()->getBlock('customer_edit');
    if ($block) {
        $block->setRefererUrl($this->_redirect->getRefererUrl());
    }

    $data = $this->session->getCustomerFormData(true);
    $customerId = $this->session->getCustomerId();
    $customerDataObject = $this->customerRepository->getById($customerId);
    if (!empty($data)) {
        $this->dataObjectHelper->populateWithArray(
            $customerDataObject,
            $data,
            \Magento\Customer\Api\Data\CustomerInterface::class
        );
    }
    $this->session->setCustomerData($customerDataObject);
    $this->session->setChangePassword($this->getRequest()->getParam('changepass') == 1);

    $resultPage->getConfig()->getTitle()->set(__('Account Information'));
    return $resultPage;
}

I found the block definition

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <update handle="customer_account"/>

        <referenceBlock name="head.components">
            <block class="Magento\Framework\View\Element\Js\Components" name="customer_account_edit_head_components" template="Magento_Customer::js/components.phtml"/>
        </referenceBlock>
        <referenceBlock name="page.main.title">
            <action method="setPageTitle">
                <argument translate="true" name="title" xsi:type="string">Edit Account Information</argument>
            </action>
        </referenceBlock>
        <referenceContainer name="content">
            <block class="Magento\Customer\Block\Form\Edit" name="customer_edit" template="Magento_Customer::form/edit.phtml" cacheable="false">
                <container name="form.additional.info" as="form_additional_info"/>
            </block>
        </referenceContainer>

</page>

And the edit.phtml basicly has only a form inside.

I understand that logic, but I need to find the information which is right before my block (my page title).

This is the resulting html in console

            Modif pwd

<input name="form_key" type="hidden" value="r2o2eCfdxErTAM4y">

<form class="form form-edit-account"></form>

I want to find where is defined this Modif pwd

Thanks


texts: Fail text input validation if value unchanged from default

texts:
Taking this product page as an example:

I'd like my text inputs (door number and street name, in the case of the example above) to fail validation if left with their default values.

I see two possible methodologies here, but I'm unsure as to which would be the better option, or how I would go about implementing either of them.

One possible approach I see would be to store the initial (default) input values after page load, and then compare the input values when 'add to cart' is clicked against the stored initial values, failing validation if they match.

The other approach I envision working would be to create a static blacklist of default input values, and when 'add to cart' is clicked, test the current input values against those in the blacklist, failing validation if matches are found.

Which would be the best approach to take and how might I go about applying it?


texts: How Do I override adminhtml phtml file without create custom module in Magento 2.1.9

texts:
I want to override \magento\module-user\view\adminhtml\templates\admin\fotgotpassword_url.phtml file without creating a custom module.

Can you please help me How do I solve the problem?


texts: Stop child product discounts applying on Bundle product

texts:
We have about 20 simple products which have a Cart Price Rule for buy 4 and get 10% off.

We also have bundle products which use these products but are already discounted. However when the rule applies it also applies to the bundle - which we do not want.

The rules appear to work correctly for "Conditions" - if you have 4 bundles only the rule does not get triggered.

However, if you have 4 of the simple products and 1 or more of the bundles the rule applies to them all, giving the bundle a discount.

We have the "conditions" set up the same as "Actions > Apply the rule only to cart items..."

Conditions (appears to be ok):

If ALL  of these conditions are TRUE :
If total quantity  equals or greater than  4  for a subselection of items in cart matching ALL  of these conditions:
Category  is  111

Apply to (where I think the issue is):

If ALL  of these conditions are TRUE :
Category  is  111
Exclude from Promotions  is not  Yes

We have tried doing various combinations and different categories, and as you can see even set up a new attribute and excluding by that - but the discount still applies to bundles!

How can we have it set up where by simple product discounts don't apply to bundles?


texts: Magento 2 - Create product attribute programmatically

texts:
I have create product attribute of type select select with below configurations:

$setup->addAttribute(\Magento\Catalog\Model\Product::ENTITY, 'attribute_code', [
            'attribute_model' => NULL,
            'backend' => '',
            'type' => 'int',
            'table' => '',
            'frontend' => '',
            'input' => 'select',
            'label' => 'Custom Attribute',
            'frontend_class' => '',
            'source' => '',
            'required' => true,
            'user_defined' => '1',
            'default' => 0,
            'unique' => '0',
            'note' => '',
            'input_renderer' => NULL,
            'global' => '1',
            'visible' => '1',
            'searchable' => '0',
            'filterable' => '1',
            'comparable' => '1',
            'visible_on_front' => '1',
            'is_html_allowed_on_front' => '0',
            'is_used_for_price_rules' => '1',
            'filterable_in_search' => '1',
            'used_in_product_listing' => '0',
            'used_for_sort_by' => '0',
            'is_configurable' => '1',
            'position' => '1',
            'wysiwyg_enabled' => '0',
            'used_for_promo_rules' => '1',
            'option' =>
                array(
                    'values' => $options,
                ),
            ]
        );

How to set default value of this custom attribute?


texts: Magento 1.9 - Add currency suffix to Base URL

texts:
I am using default currency switcher, want to add currency ISO code suffix with base URL. Like http://www.example.com/ to http://www.example.com/currency=USD when switch currency.

Any help?


texts: How to get store logo url in Javascript file in Magento 2?

texts: I want to load store logo image URL in javascript so i can bind it to my knockout element, how can i achieve that?


texts: Magento 2 - Jquery not triggering any events for Product attribute input fields in new product form

texts:
I have a product attribute named stone_weight. I'm trying to get the value of the attribute based on it's name name="product[stone_weight]" on change event. But it is not triggering any event. How can i properly use any event like change or keyup.

require.config({
        deps: [
            'jquery'
        ],
        callback: function ($) {
            $(document).ready(function(e){
                $('input[name="product\\[stone_weight\\]"]').change(function(e){
                    $stone = $('input[name="product\\[stone_weight\\]"]').val();
                    console.log($stone);
                });
            })
        }
    });


texts:
I installed and configured PayU.pl extension in Magento. But when I test and try to place an order, it shows me the following errors after I try to checkout with PayU.pl as payment method.

There has been an error processing your request

Trace:
#0 /home/xxxxo/public_html/lib/payu/sdk_v21/OpenPayU/v2/Order.php(185): OpenPayU_Http::throwHttpStatusException(401, Object(OpenPayU_Result))
#1 /home/xxxxo/public_html/lib/payu/sdk_v21/OpenPayU/v2/Order.php(53): OpenPayU_Order::verifyResponse(Array, 'OrderCreateResp...')
#2 /home/xxxxo/public_html/app/code/community/PayU/Account/Model/Payment.php(272): OpenPayU_Order::create(Array)
#3 /home/xxxxo/public_html/app/code/community/PayU/Account/Block/Redirect.php(40): PayU_Account_Model_Payment->orderCreateRequest(Object(Mage_Sales_Model_Order), Array)
#4 /home/xxxxo/public_html/app/code/core/Mage/Core/Block/Abstract.php(919): PayU_Account_Block_Redirect->_toHtml()
#5 /home/xxxxo/public_html/app/code/community/PayU/Account/controllers/PaymentController.php(62): Mage_Core_Block_Abstract->toHtml()
#6 /home/xxxxo/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(418): PayU_Account_PaymentController->newAction()
#7 /home/xxxxo/public_html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('new')
#8 /home/xxxxo/public_html/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#9 /home/xxxxo/public_html/app/code/core/Mage/Core/Model/App.php(365): Mage_Core_Controller_Varien_Front->dispatch()
#10 /home/xxxxo/public_html/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#11 /home/xxxxo/public_html/index.php(83): Mage::run('', 'store')
#12 {main}

Error log record number: 461458235548

Any idea where is the issue and how i can solve it? Its been a while and i am unable to fix this one. Thanks


texts: How to Remove Backend Bulk Action Buttons

texts:
In the backend of magento, under Sales> Orders, Catalog> Manage Products and Clients> Manage Clients, you have the field of actions from which one of them is to exclude and in this case excludes all items from which they are selected.

I was wondering if I would have some way to remove the field from all those pages in the magento backend, so I can avoid deleting crucial bulk information.


texts: website need to redirected to https://www

texts:
Site URL is https://www.spam.com/  but unfortunately it works with https://spam.com/.

This is wrong. can anyone suggested me how we can redirect to https://www.spam.com/


texts: Clear the Text box data in the magento 2 module when validation fails in beforeSave event

texts: I have a textbox which gets a input from the User. I have created a validation point using beforeSave function. If the validation fails, An error displays. Along with this I want to delete the value from the textbox. How to achieve this?


texts: Magento Patches (wrong names, not corresponding with version)

texts:
Recently I figured that many patches I have installed in year 2014-2015 like SUPEE  1533 SUPEE-5994 have messed up names. When looking thought installed patch.list
For 1.7.0.2, the Supee 5994 shows as
PATCH_SUPEE-5998_EE_1.14.1.0

EE stands for enterprise 1.14...  I am pretty sure when I downloaded Patch it in May 2015 as it was released, it was for 1.7.0.2 Magento community version.. I went back today to compare with currently available SUPEE 5994 from the list and looks like they were all renaimed.

What is the deal with magento naming patches with titles not corresponding with their version?

I am now thinking, if I ever need to revert the original patch, I can't event download it anymore from magento. They are now renamed.
How to revert patches if I don't have original patch?


texts: Magento 2 add new text filed at custom options section?

texts: How can I add a new text field in the custom options section in Magento 2  as shown in the screenshot below?


texts: How can i programatically get customer full addresses in string type?

texts:
public function Address()
{
    $customerId = "8";
    $customer = $this->customerRepository->getById($customerId);
    $addresses = $customer->getAddresses();
    $billingAddress = $customer->getDefaultBilling();
    $shippingAddress = $customer->getDefaultShipping();
    return  $billingAddress;
}

In this code is only getting the id I want the address as a string.please help me.


texts:
I have an iframe on the product page that holds a personlisation tool. I want to use a yes/no product attribute in the frame to show or hide a tab. I've tried the following but get error Call to a member function getData() on a non-object

<?php if($_product->getData('has_photo')==1){?>

<?php echo
$this->__('Graphics'); ?>

<?php } ?>


texts: Magento 2 How to fetch rest API array value

texts:
I got sales order details from Rest API.

How to fetch this values(like When i call base_currency_code it will show USD).
Thank you.


texts: add bundle Product (addProduct function) returns Please specify product option(s)

texts:
I'm new on Magento and I have an issue when trying to add a bundle item to cart/quote returning an error message

Please Specify product option(s).

this is the code I'm using
$cart = Mage::getModel('checkout/cart');
$cart->init();
$quote = $cart->getQuote();
$product = Mage::getModel('catalog/product')->load($productDetails["product_id"]);

if($product->getTypeId() == Mage_Catalog_Model_Product_Type::TYPE_CONFIGURABLE){
    $params = new Varien_Object([
            'product' => $productDetails["product_id"],
            'qty' => $productDetails["qty"],
            'super_attribute' => $productDetails["attributes"],
        ]);
}elseif($product->getTypeId() == Mage_Catalog_Model_Product_Type::TYPE_BUNDLE){
    $params = new Varien_Object([
            'product' => $productDetails["product_id"],
            'qty' => $productDetails["qty"],
            'bundle_option' => $productDetails["bundle_option"],
            'bundle_option_qty' => $productDetails["bundle_option_qty"],
        ]);
}else{
    $params = $productDetails['qty'];
}

$quote->addProduct($product, $params);

CAN SOMEONE PLEASE HELP ME??? I've been stuck on this for 5days now
GREATLY APPRECIATE ANY HELP.


texts: How to save Magento2 's type 'checkboxes' in admin form?

texts:
In Magento 2 there is form field type 'checkboxes'.
I've added it to my adminhtml edit form:

// app\code\Vendor\Module\Block\Adminhtml\Point\Edit\Form.php

$balloonFieldset->addField(
            'payment_types',
            'checkboxes',
            [
                'label' => __('Payment Types'),
                'name' => 'payment_types',
                'values' => [
                    ['value' => '2','label' => 'Card'],
                    ['value' => '3','label' => 'Cash'],
                    ['value' => '4','label' => 'Prepaid'],
                ],
            ]
        );

And it looks like this:

I've tried to store it in database in varchar field with imploding and exploding it in model:

    /**
     * Set payment_types
     *
     * @param array $paymentTypes
     * @return \Vendor\Module\Api\Data\PointInterface
     */
    public function setPaymentTypes($paymentTypes)
    {
        $stringTypes = implode(', ', $paymentTypes);

        return $this->setData(self::PAYMENT_TYPES, $stringTypes);
    }

    /**
     * Get payment types
     *
     * @return string|null
     */
    public function getPaymentTypes()
    {
        return explode(', ', $this->getData(self::PAYMENT_TYPES));
    }

But it always saves the last checkbox's value.
For example: if I check 'Card' and 'Cash', in database it will be '3', if I check 'Cash' and 'Prepaid', it will be '4' and so on.

Saving it as a string suits perfect for me, but I need it to save correct values: '2, 3' in first case and '3, 4' in second.

What is the right way of doing this?


texts: How to change Max Depth of Top Category Navigation for specific store?

texts:
There is an admin setting called System -> Configuration -> Catalog -> Category Top Navigation -> Maximal Depth, which is only available in global scope.

What is the reason of hiding this setting for scopes other than global?
How to change this setting for specific Website/Store, if I have a multisite?

Magento ver. 1.4.2.0


texts:
I want in cart add also and shipping cost:

Let me know if this possible?


texts: Getting Helper errors despite defining helpers in Data

texts:
I am getting the following error:

  Fatal error: Class 'Mage_VMR_Customreports_Helper_Data' not found in
  /Volumes/Apache/mage/app/Mage.php on line 546

where VMR is my namespace and Customreports is my module name.

Now usually I fix this by putting

class Mage_VMR_Customreports_Helper_Data extends Mage_Core_Helper_Abstract
{

}

in /Helper/Data.php  but that isn't fixing it this time.

I have noticed that the error changes when I change the menu definition in config.xml

which is currently:

<menu>
    <vmr_menu>
        <children>
            <customreports translate="title" module="VMR_Customreports">
                ...
            </customreports>
        </children>
    </vmr_menu>
</menu>

My config.xml helper stuff is:

<global>
    <helpers>
        <customreports>
            <class>VMR_Customreports_Helper</class>
        </customreports>
    </helpers>
</global>

and my Data.php is:

<?php

class VMR_Customreports_Helper_Data extends Mage_Core_Helper_Abstract
{

}

class Mage_VMR_Customreports_Helper_Data extends Mage_Core_Helper_Abstract
{

}

How do I fix it?


texts: Just to confirm and share: how to apply for magento patch supee-5344

texts:
I found a possible solution for those who have no SSH access, or having difficulties using sh command to apply for the patch: (community edition)

With the successful update on the local machine, find the 5 files on your local machine which have the updates:

app/code/core/Mage/Admin/Model/Observer.php

app/code/core/Mage/Core/Controller/Request/Http.php

app/code/core/Mage/Oauth/controllers/Adminhtml/Oauth/AuthorizeController.php

app/code/core/Mage/XmlConnect/Model/Observer.php

lib/Varien/Db/Adapter/Pdo/Mysql.php

upload these files to your server using FTP, and patches are done!

To me, this is a safer option to apply for the patches.

Pls correct me if I am wrong! Hopefully it helps.


texts:
The currency symbol ($) is missing when changing the store view to Arabic Language.

I got two store views in my shop.

1 english and 1 arabic(ar_SA)

Standard currency is $ in all my shop.

On english store view the shop shows me $ 100.00 for example. On arabic store view I just get the Number itself like 100.00.

Can someone tell me why the $ is missing?


texts:
I have a controller Callback.php in folder app/code/Dots/Socialfeeds/Controller/Social in custom module  Dots_Socialfeeds.

I am also using an third party library file Linkedin.php which I have placed in folder lib/external/Dots/Socialfeeds/Linkedin.

Now I want to use this lib class in my above controller Callback.php.

code--

<?php

namespace Dots\Socialfeeds\Controller\Social;

use Magento\Framework\App\Action\Action;
use Dots\Socialfeeds\Linkedin\Linkedin;

/**
 * Class Callback
 *
 * @package Dots\Socialfeeds\Controller\Social
 */
class Callback extends Action
{
    /**
     * @inheritdoc
     */
    public function execute()
    {
        $li =   new \Linkedin(
                      array(
                        'api_key' => '81a592y6mz9o33',
                        'api_secret' => 'kviv5GtPAt3ZDHpq',
                        'callback_url' => 'http://ds01.projectstatus.co.uk/c2cwp/test.php?type=linkedin'
                      )
                    );
       $token = $li->getAccessToken($_GET['code']);
    }

}

and lib file code --

    <?php
namespace Dots\Socialfeeds\Linkedin;

class Linkedin
{
private $_config = array();
private $_state = null;
private $_access_token = null;
private $_access_token_expires = null;
private $_debug_info = null;
private $_curl_handle = null;

const API_BASE = 'https://api.linkedin.com/v1';
const OAUTH_BASE = 'https://www.linkedin.com/uas/oauth2';

const SCOPE_BASIC_PROFILE = 'r_basicprofile'; // Name, photo, headline, and current positions
const SCOPE_FULL_PROFILE = 'r_fullprofile'; // Full profile including experience, education, skills, and recommendations
const SCOPE_EMAIL_ADDRESS = 'r_emailaddress'; // The primary email address you use for your LinkedIn account
const SCOPE_NETWORK = 'r_network'; // Your 1st and 2nd degree connections
const SCOPE_CONTACT_INFO = 'r_contactinfo'; // Address, phone number, and bound accounts
const SCOPE_READ_WRITE_UPDATES = 'rw_nus'; // Retrieve and post updates to LinkedIn as you
const SCOPE_READ_WRITE_GROUPS = 'rw_groups'; // Retrieve and post group discussions as you
const SCOPE_READ_WRITE_COMPANY_ADMIN = 'rw_company_admin'; // Administers a company as you
const SCOPE_WRITE_MESSAGES = 'w_messages'; // Send messages and invitations to connect as you
const SCOPE_WRITE_SHARE = 'w_share'; // Share url to your contacts

const HTTP_METHOD_GET = 'GET';
const HTTP_METHOD_POST = 'POST';
const HTTP_METHOD_PUT = 'PUT';
const HTTP_METHOD_DELETE = 'DELETE';

/**
 * @param array $config (api_key, api_secret, callback_url)
 * @throws \InvalidArgumentException
 * @throws \RuntimeException
 */
public function __construct(array $config)
{
    if (!isset($config['api_key']) || empty($config['api_key'])) {
        throw new \InvalidArgumentException('Invalid api key - make sure api_key is defined in the config array');
    }

    if (!isset($config['api_secret']) || empty($config['api_secret'])) {
        throw new \InvalidArgumentException('Invalid api secret - make sure api_secret is defined in the config array');
    }

    if (!isset($config['callback_url']) || empty($config['callback_url'])) {
        throw new \InvalidArgumentException('Invalid callback url - make sure callback_url is defined in the config array');
    }

    if (!extension_loaded('curl')) {
        throw new \RuntimeException('PHP CURL extension does not seem to be loaded');
    }

    $this->_config = $config;
}

 .....
 .....

I am getting error if in controller file-

  Fatal error: Uncaught Error: Class 'Linkedin' not found in app/code/Dots/Socialfeeds/Controller/Social/Callback.php:24


texts: Change order of configurable options programatically

texts:
I have several products like the one depicted below. We want shelf finish to be the first choice and load capacity to be the second one. I understand this can be changed in the admin panel however I have well over 300 products like this and manually changing every single product would take days.

Does anyone have a programmatic solution (PHP or SQL) to flip these choices?


texts: How can I programmatically perform a 301 redirect in Magento?


texts: How can registered customer have two active quotes?

texts:
I witness something strange, and I can't quite get a grip on it. I have only the data left to investigate, and here is what I have.

Registered customer created a quote A.
Before customer could checkout quote A, another but identical quote was created. Let's call this quote B.
Customer came back to his quote at some point and converted it into a sale. However, he converted quote A!
My data show quote A was converted into a sale and quote B was left as-is. Quote B was created about 5 hours before quote A was converted.

Other thing(s):

There are no third-party extensions that create quotes.

Now, I don't understand how quote A was checked out and not B, even if somehow his session was interrupted and quote B was created for him.

Any ideas anybody?


texts: Is there an optimal word length for category page descriptions?

texts: I'm currently writing up my category descriptions to be displayed on-page. Besides taking into account keywords, usefulness of the text, how much space it takes up etc. Is there an optimal amount of words that should be used that search engines like to see?


texts: Magento 2.4.0-1 Bitnami Stack for Mac is very slow

texts:
I installed Magento 2.4.0-1 Bitnami Stack on my Mac and the pages are loading extremely slowly. Even when I already see the picture of the home page, it keeps loading.
I’m using MacBook Pro (Retina, Mid 2012), Processor 2,6 GHz Quad-Core Intel Core i7, Memory 8 GB 1600 MHz DDR3.
Is there a solution to make pages load fast?
What is the best development environment btw (preferrably local)?
Thank you in advance!


texts: Magento 1 to 2 Data Migration - EAV Step Error

texts:
Updating another Magento 1 website to Magento 2 - haven't faced this issue before:

Magento 1.9.3.4 to Magento 2.3.3

Notice: Undefined offset: 1 in /home/XXX/public_html/XXX/vendor/magento/data-migration-tool/src/Migration/Step/Eav/Data.php on line 292

I was initially facing issues of the duplicated 'Default' entries coming over:

SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '182' for key 'PRIMARY'

But I removed these from the Magento 1 environment, fresh install of Magento 2 Database.

Then, run command:

php73 bin/magento migrate:data -r -a vendor/magento/data-migration-tool/etc/opensource-to-opensource/1.9.3.4/config.xml

Which gives me the above error.

Looking at Migration fails with "Notice: Undefined offset: 1" - I am using a clean install (from Softaculous) of Magento 2.

So I shouldn't face this issue when running the migration command on a clean Magento 2 database, should I?

Thanks in advance for any assistance!


texts: Check if default billing address in checkout - Magento 2.3

texts:
Inside the checkout /app/design/theme/theme/Magento_Checkout/view/frontend/web/template/shipping.html file I would like to check if the customer does have a default billing address.
Is there a knockout possibility to check this? Something like:
<!-- ko if: (customerHasAddresses && isAddressFormListVisible)-->
    Got default address
<!-- /ko -->

But the code above does not seem to work in this template.


texts: Magento 2 - Show cart quantity without decimals

texts:
I have to show the total quantity of the items in the cart. I'm doing this now with:

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$cart = $objectManager->get('\Magento\Checkout\Model\Cart');

$totalItems = $cart->getQuote()->getItemsCount();
$totalQuantity = $cart->getQuote()->getItemsQty();

echo $totalQuantity;

I have 5 items in the cart and the $totalQuantity will show 5.0000 Why is that? And how can I just display 5?

Regards,
Robert


texts: I had changed ''add to cart '' button into enquiry then I BUILT UP a popup but I feel it is not good so I want recover my ''add to cart'' but really can not,I would love to get some help from professionals.


texts:
I have enabled flat catalog in the magento admin. When i want to post image and hyperlink to website from facebook it cause fatal error

  Fatal error: Call to undefined method Mage_Catalog_Model_Resource_Category_Flat::getProductsPosition() in /app/code/core/Mage/Catalog/Model/Category.php on line 330

the website has 6000 products and without flat catalog enabled the product page load time is 8 second so i cannot afford to disable flat catalog.


texts: Magento2 search like searching using REST API

texts:
When using magento search REST API you can search with logical AND search

http://devdocs.magento.com/guides/v2.0/howdoi/webapi/search-criteria.html#logical-and-search

For example I want to search all product that contains shower and bath in the name. With an api request this is pretty simple.

http://local.webshop/rest/V1/products?
    searchCriteria[filter_groups][0][filters][0][field]=name&
    searchCriteria[filter_groups][0][filters][0][value]=%25bath%25&
    searchCriteria[filter_groups][0][filters][0][condition_type]=like&
    searchCriteria[filter_groups][1][filters][0][field]=name&
    searchCriteria[filter_groups][1][filters][0][value]=%25shower%25&
    searchCriteria[filter_groups][1][filters][0][condition_type]=like

Now I want to search like this in my magento2 website using the default search input text. I don't want to make an API request. How would I change this? The default magento search functionality uses Logical OR search

I updated the _renderFiltersBefore() in Magento\CatalogSearch\Model\ResourceModel\Fulltext\Collection

/**
 * @inheritdoc
 */
protected function _renderFiltersBefore()
{
    $this->getSearchCriteriaBuilder();
    $this->getFilterBuilder();
    $this->getSearch();

    $priceRangeCalculation = $this->_scopeConfig->getValue(
        \Magento\Catalog\Model\Layer\Filter\Dynamic\AlgorithmFactory::XML_PATH_RANGE_CALCULATION,
        \Magento\Store\Model\ScopeInterface::SCOPE_STORE
    );

    $searchCriteria = $this->searchCriteriaBuilder->create();

    $this->filterGroupBuilder = ObjectManager::getInstance()->get('\Magento\Framework\Api\Search\FilterGroupBuilder');
    /*
    Filter 1
     */
    $filter1 = $this->filterBuilder->setField('search_term')
        ->setValue('bath')
        ->create();
    $filterGroup1 = $this->filterGroupBuilder->addFilter($filter1)->create();

    /*
    Filter 2
     */
    $filter2 = $this->filterBuilder->setField('search_term')
        ->setValue('tap')
        ->create();
    $filterGroup2 = $this->filterGroupBuilder->addFilter($filter2)->create();

    if ($priceRangeCalculation) {
        $priceFilter = $this->filterBuilder->setField('price_dynamic_algorithm')
        ->setValue($priceRangeCalculation)
        ->create();
        $filterPriceGroup = $this->filterGroupBuilder->addFilter($priceFilter)->create();
    }

    $searchCriteria->setFilterGroups([$filterPriceGroup, $filterGroup2, $filterGroup1]);
    $searchCriteria->setRequestName($this->searchRequestName);

    try {
        $this->searchResult = $this->getSearch()->search($searchCriteria);
    } catch (EmptyRequestDataException $e) {
        /** @var \Magento\Framework\Api\Search\SearchResultInterface $searchResult */
        $this->searchResult = $this->searchResultFactory->create()->setItems([]);
    } catch (NonExistingRequestNameException $e) {
        $this->_logger->error($e->getMessage());
        throw new LocalizedException(__('Sorry, something went wrong. You can find out more in the error log.'));
    }

    $temporaryStorage = $this->temporaryStorageFactory->create();
    $table = $temporaryStorage->storeApiDocuments($this->searchResult->getItems());

    $this->getSelect()->joinInner(
        [
            'search_result' => $table->getName(),
        ],
        'e.entity_id = search_result.' . TemporaryStorage::FIELD_ENTITY_ID,
        []
    );

    $this->_totalRecords = $this->searchResult->getTotalCount();

    if ($this->order && 'relevance' === $this->order['field']) {
        $this->getSelect()->order('search_result.'. TemporaryStorage::FIELD_SCORE . ' ' . $this->order['dir']);
    }
    return parent::_renderFiltersBefore();
}

This is not returning the expected results.

Thanks


texts: Knowing which Classes to utilise in Magento 2 for Dependency Injection

texts:
I've begun learning Magento 2 recently, whereas I've gotten a pretty good grasp of understanding the methodology of DI.

Add the expected Interfaces & Classes in di.xml
Add to Constructor of your Controller
Pass the initiated class to a protected member & begin developing.

However I've gotten to that point where I'm asking myself, "I need to check existence of a Category" at Controller level. I begin hitting CTRL + Space for Auto-complete on my IDE, digging through hundreds of possible similarly named Classes:

\Magento\Catalog\Model\Category\
\Magento\Catalog\Model\CategoryManagement
\Magento\Catalog\Model\CategoryRepository
\Magento\Catalog\Model\Category\Tree
\Magento\Catalog\Helper\Catalog
and More... !

I find it that any of these classes could facilitate my requirements - however I could be adding more technical debt without knowing it.

Magento 1 seems to have a good wealth of Developer Docs on Classes - But Magento 2 lacks this.

Is there a general convention that an experienced Magento developer goes by when knowing what requirements he requires to complete a task, or is this all down to a steep learning curve?

Apologies if this is a quite a broad question, not code specific.


texts:
We are facing issues after logging into Magento 2 Admin. The login screen came and after logging in, no dashboard appeared.

Instead, this error came up at URL http://127.0.0.1/mage2ee/admin_o0exa8/admin/index/index/key/dbb62ca5c9c5ba2c36eceef7609226751a25f78...

  This page can't be displayed.

I checked the system and debug logs, but I am not able to find anything.

The configuration is:

apache 2.4.9
php 5.5.12
mysql 5.6.17

I Checked cookies too, and the admin cookie is there.

I believe, right now Magento is working into default mode as we have not made any change till now.

From WAMP logs, below error was found:

php_error.log:

  PHP Warning:  PHP Startup: Unable to load dynamic library 'D:/wamp/bin/php/php5.5.12/ext/php_ldap.dll' - The specified module could not be found. in Unknown on line 0

Is this error in relation to Magento 2 backend authorization?

In addition, there is an issue in loading of CSS as well in the admin panel.

Please help on this.


texts:
I'm a bit confused trying to read/compare Exception.log content and /var/report/

What is the timezone used ?

For Exception.log we have lines like the following one:
2014-06-05T12:57:49+00:00 ERR (3): ...
For Reports we have files and file creation time.

So If I'm right the Exception logs uses UTC while the reports uses the Server time, am I right here ?


texts: Add custom link near search box in Magento 2?

texts:
I already check many answers regarding move header.links to page.top its working but the problem is that its also move my custom links to header content.

that's why I remove greeting message, Sign in, Create an account & add custom links to the top menu, but now I did not found any solution to add sign in, Create an account link & Greeting message into the header-content or near the search box.

I tried by creating default.xml into app/design/.../Magento_Theme/layout, but its not working, I added custom link by module, so please give me solution which can achieve by module.

Here is my default.xml

File Path:

  app/code/vendor/modulename/view/frontend/layout/default.xml

 <body>
    <referenceBlock name="header.links">

        <!-- Contact us Link -->
        <block class="Magento\Framework\View\Element\Html\Link" name="contactus.link" after="register-link">
            <arguments>
                <argument name="label" xsi:type="string" translate="false">Contact Us</argument>
                <argument name="path" xsi:type="string" translate="false">contact-us</argument>
            </arguments>
        </block>

        <!-- CMS Page Link Link -->
        <block class="Magento\Framework\View\Element\Html\Link" name="aboutus.link" after="contactus.link">
            <arguments>
                <argument name="label" xsi:type="string" translate="false">About Us</argument>
                <argument name="path" xsi:type="string" translate="false">about-us</argument>
            </arguments>
        </block>

        <!-- CMS Page Link Link -->
        <block class="Magento\Framework\View\Element\Html\Link" name="customerservice.link" after="customerservice.link">
            <arguments>
                <argument name="label" xsi:type="string" translate="false">Customer Service</argument>
                <argument name="path" xsi:type="string" translate="false">customer-service</argument>
            </arguments>
        </block>

        <referenceBlock name="register-link" remove="true" />
        <referenceBlock name="authorization-link-login" remove="true" />
        <referenceBlock name="wish-list-link" remove="true" />
        <referenceBlock name="my-account-link" remove="true" />
    </referenceBlock>

</body>

I also tried add link by using page.top but its shows link below the header-content.


texts: Images work on local server but not production

texts:
I am working on a Magento 1.9.0 store on my local machine and I have recently pushed it out to the production server, but I am having some problems with "missing" images (they fall back to placeholder images)

They all work flawlessly everywhere on my local MAMP machine
On the production server they work when customers browse for the products using categories
On the production server they work in the back end admin system
On the production server they don't work in the search result pages
On the production server they don't work in the individual product listing pages.

I have tried:

Removing the cache folder
chmod 777 /var/cache
chmod 777 /media
Rebuilding all indexes
Flushing all caches via admin panel
Reindexing everything via admin panel

I'm not sure what else I can try?
Any assistance would be greatly appreciated.


texts: I'm using laravel in my application ,but I need to use the Magento getVersion method via Magento webservices how can I do that is it possible to do that? can any one help me ?


texts:
My update cron job is failing. The cron entry is:

* * * * * /usr/bin/php -c /etc/php5/apache2/php.ini /var/www/magento2/update/cron.php >> /var/www/magento2/var/log/update.cron.log

and the error is:

Parse error: syntax error, unexpected '.', expecting ')' in /var/www/magento2/update/app/code/Magento/Update/UpdateLoggerFactory.php on line 31

Line 31 from UpdateLoggerFactory.php:

 $logFile = MAGENTO_BP . '/var/log/update.log',

belonging to the block:

public function __construct(
    $logFile = MAGENTO_BP . '/var/log/update.log',
    $channelName = 'update-cron'
) {

I am using Ubuntu Server 14.04, php 5.5.9, Apache 2.4.7

Any ideas?


texts:
if we do any modifications or if we add any image in tm_slider block and click on save button it is taking much time and getting 504 gateway time error and website is also not working 10 t0 15 mins at this time and when i check in system log i am getting below errors

  [2019-05-28 16:15:33] main.ERROR: Unable to resolve the source file
  for 'adminhtml/Magento/backend/en_US/images/5percentoffer.png' [] []
  [2019-05-28 16:15:33] main.CRITICAL: Unable to resolve the source file
  for 'adminhtml/Magento/backend/en_US/images/5percentoffer.png' [] []
  [2019-05-28 16:15:33] main.ERROR: Unable to resolve the source file
  for 'adminhtml/Magento/backend/en_US/images/banner5.png' [] []
  [2019-05-28 16:15:33] main.CRITICAL: Unable to resolve the source file
  for 'adminhtml/Magento/backend/en_US/images/banner5.png' [] []
  [2019-05-28 16:15:36] main.ERROR: Unable to resolve the source file
  for 'adminhtml/Magento/backend/en_US/images/main-banner.jpg' [] []
  [2019-05-28 16:15:36] main.CRITICAL: Unable to resolve the source file
  for 'adminhtml/Magento/backend/en_US/images/main-banner.jpg' [] []
  [2019-05-28 16:15:38] main.ERROR: Unable to resolve the source file
  for 'adminhtml/Magento/backend/en_US/images/5percentoffer.png' [] []
  [2019-05-28 16:15:38] main.CRITICAL: Unable to resolve the source file
  for 'adminhtml/Magento/backend/en_US/images/5percentoffer.png' [] []
  [2019-05-28 16:15:41] main.ERROR: Unable to resolve the source file
  for 'adminhtml/Magento/backend/en_US/images/banner2.jpg' [] []
  [2019-05-28 16:15:41] main.CRITICAL: Unable to resolve the source file
  for 'adminhtml/Magento/backend/en_US/images/banner2.jpg' [] []
  [2019-05-28 16:15:41] main.ERROR: Unable to resolve the source file
  for 'adminhtml/Magento/backend/en_US/images/banner2.jpg' [] []
  [2019-05-28 16:15:41] main.CRITICAL: Unable to resolve the source file
  for 'adminhtml/Magento/backend/en_US/images/banner2.jpg' [] []
  [2019-05-28 16:15:42] main.ERROR: Unable to resolve the source file
  for 'adminhtml/Magento/backend/en_US/images/banner5.png' [] []
  [2019-05-28 16:15:42] main.CRITICAL: Unable to resolve the source file
  for 'adminhtml/Magento/backend/en_US/images/banner5.png' [] []


texts: Displaying Simple Product Stock On Configurable Product

texts:
Im currently using Magento CE 1.9 and I want to display the individual stock quantities of all the simple products associated with the configurable product.

When you click the "Only X Left" message on the product page on the front end these products display as per /template/cataloginventory/stockqty/composite.phtml

However only the quantities are showing but the simple product titles are note displaying.

Can anyone suggest why the titles aren't displaying and how to fix this?

Also how can you get this table to display showing all the quantities to display without having to click on the message?


texts: Magento 2 programmatically get latest products?

texts: How can i get latest products programmatically in magento 2?


texts: When writing modules, why do company names have to start with a capital?

texts:
I just spent a good couple of hours trying to figure out why the heck my simple test module seemed to be recognised by Magento but not working. It turns out it was because I had named it aXeHeadCoding_ObserverTest, and some part of the module system doesn't like the lowercase first letter. I don't know whether it's the config XML or the name of the directory, but it really screwed me over.

Now I'm curious. Is there a known reason for requiring a starting capital letter? And/or which part of the system is it that requires the capital letter? (I realise I could find out myself by simply changing each instance of AXeHeadCoding to aXeHeadCoding until it breaks, but trial and error isn't my favourite way to determine this sort of thing)


texts: How to update product prices and their custom option prices by the same percentage in bulk?

texts:
I am quite new to the Magento platform and have been slowly getting the hang of it, but have come to an issue I need help with resolving.

A lot of the products on my website have custom options which have different prices than that of the base product. I am fortunate in the way that, whenever I need to update the price of the base product, I have to update the custom option prices by the same percentage. But even so, with a lot of products on my website, this becomes quite troublesome if I have to do it one by one.

So, what I would like to ask is, what would be the best way to change prices of certain products in bulk, as well as their custom options prices at the same time by the same percentage?

Is there an extension which would allow me to do that, or should I take on this issue from a different angle all together?

I would like to thank you for any help in advance and if any part of my question is unclear, please ask for a further explanation.


texts: How to get product random collection in magento2?

texts:
I want to get the random 10 products from whole product collection in magento2.

$productCollection = $this
        ->productModel
        ->getProductCollection()
        ->addAttributeToSelect('*');

$productCollection->getSelect()->orderRand();

$productCollection->setPagesize(10);

How to get the products without loading the whole product collection.

Thanks.


texts: JS works in jsfiddle, but wont work in Magento checkout

texts:
I have added JS to my checkout with jsrequire and I can see my JS file in the developer console.

For testing I tried to console.log the firstname field value on input, like this:

   var name = $("[name='firstname']");

   name.on('input', function(){ console.log(name[0].value);})

It is working in JSfiddle: here.

But it won't work in Magento checkout, I don't get any errors (I do get errors if I write incorrect JS/JQ code).


texts: session_regenerate_id(): Session object destruction failed

texts: I'm getting this error sometimes from app\code\core\Mage\Core\Model\Session\Abstract\Varien.php . I'don't know when it's happening just pops up sometimes.


texts: Magento Frontend form date picker today date is wrong

texts:
I want to setup date picker in frontend form,

and I did this currently,
datepicker is shown in a frontend form

only one issue is that when I click on today in datepicker it take the wrong date

screenshot: -

<script type="text/javascript">
                      //<![CDATA[
                          Calendar.setup({
                              inputField: "RebillStartDate",
                              ifFormat: "%d/%m/%Y",
                              showsTime: true,
                              button: "rebillstartdate",
                              align: "Bl",
                              singleClick : true
                            });
                     //]]>
</script>


texts: Categories not displaying in responsive side menu

texts:
I'm making a custom navbar, and I've moved the 'catalog.topnav' block into my custom navigation.

The problem is, is that some of the sections and categories on the responsive side menu are not showing up. This is not a problem when you don't move the block and leave it in its original position. Which leads me to believe that this is a javascript thing, that's grabbing the categories. However, I have no idea why that would be the case since there's got to be a better way of doing it.

The categories showing up in the main navigation:

The categories not showing up in the side navigation:

And here it is when not moved:

This only happens when I move the block. If I leave it in its original position it's perfectly fine.

Navbar XML

<referenceContainer name="header.container">
  <referenceContainer name="header.panel.wrapper" remove="true" />
  <referenceContainer name="header-wrapper" remove="true" />
  <container name="nav" as="nav" htmlClass="nav-main" htmlTag="div">
    <block class="Magento\Framework\View\Element\Template" name="nav.logo" template="Magento_Theme::home/nav/logo.phtml" />
    <container name="nav.links" htmlClass="nav-links" htmlTag="div">
      <block class="Magento\Framework\View\Element\Template" name="nav.side-menu" template="Magento_Theme::home/nav/side-menu.phtml" />
      <container name="nav.side-links" htmlClass="side-links" htmlTag="ul">
        <block class="Magento\Framework\View\Element\Template" name="nav.boat-toggle" template="Magento_Theme::home/nav/boat/boat.phtml" />
      </container>
      <container name="nav.boat-menu" as="nav.boat" htmlClass="nav-boat-hidden" htmlTag="div">
        <block class="Magento\Framework\View\Element\Template" name="nav.boat.login" template="Magento_Theme::home/nav/boat/login.phtml" />
        <block class="Magento\Framework\View\Element\Template" name="nav.boat.account-links" template="Magento_Theme::home/nav/boat/account-links.phtml" />
        <block class="Magento\Framework\View\Element\Template" name="nav.boat.languages" template="Magento_Theme::home/nav/boat/languages.phtml" />
      </container>
    </container>
  </container>
</referenceContainer>

<move element="catalog.topnav" destination="nav.links" after="-" />

Cheers guys! Any help is much appreciated!


texts:
I found an interesting workaround for an issue I was having; not sure if it's best-practice, but I was wondering if someone could explain to me how this works:

I needed to provide a check on postdispatch for a category load
Created an observer, inspect the Mage::registry('current_category')
If the category matches the category in question, I do some getStoreConfig inspection to a custom module, and based on the return, I either do nothing (let the request sail through) or redirect to another page

What I found is that with Enterprise Full Page Cache enabled, my postdispatch event was never firing.

Which raises the question:

http://cdn.meme.li/i/o5acb.jpg

My solution:

In my custom module's controller I created a new action which effectively just calls $this->_forward() to the category as before. But now, instead of FPC intercepting my event, the event is fired correctly.

My question:

Is this poor practice?

Is there a better suggested workaround?

It seems less "hacky" than fully disabling FPC for the category in question... though that may have been the actual result of the _forward. The end-user experience is seamless and all category features work as-expected from there including pagination, layered navigation.


texts:
I have a custom checkout step that i want to try and disable if i have no products in my crosssell however i cant figure out how to disable the step in below code:

define(
[
    'ko',
    'uiComponent',
    'underscore',
    'Magento_Checkout/js/model/step-navigator'
],
function (
    ko,
    Component,
    _,
    stepNavigator
) {
    'use strict';
    /**
    *
    * mystep - is the name of the component's .html template,
    * <Vendor>_<Module>  - is the name of the your module directory.
    *
    */
    return Component.extend({
        defaults: {
            template: 'Harrigo_CrosssellCheckout/crosssellstep'
        },

        //add here your logic to display step,
        isVisible: ko.observable(true),

        /**
        *
        * @returns {*}
        */
        initialize: function () {
            this._super();
            // register your step
            stepNavigator.registerStep(
                //step code will be used as step content id in the component template
                'crosssell_step',
                //step alias
                null,
                //step title value
                'Interested in?',
                //observable property with logic when display step or hide step
                this.isVisible,

                _.bind(this.navigate, this),

                /**
                * sort order value
                * 'sort order value' < 10: step displays before shipping step;
                * 10 < 'sort order value' < 20 : step displays between shipping and payment step
                * 'sort order value' > 20 : step displays after payment step
                */
                5
            );

            return this;
        },

        /**
        * The navigate() method is responsible for navigation between checkout step
        * during checkout. You can add custom logic, for example some conditions
        * for switching to your custom step
        */
        navigate: function () {

        },

        /**
        * @returns void
        */
        navigateToNextStep: function () {
            stepNavigator.next();
        }
    });
}
);

There are sections for logic to display step but simply setting this to false does not seem to work.


texts: JavaScript event on product configuration change

texts:
Is there already a JavaScript event for when a customer changes the configuration of a product, say changed/selected a different color? Maybe a click/change event of the switches?

## Update 1

We're looking for an event that we can bind to or observe, so we don't need to modify any existing script.


texts:
I am using Docker for the magento.
when I try fin project up
the elasticsearch looks likes like it can be startup, but when I check the status.
it is offline, any recommendation that I can get it fix?


texts: How to edit a web page source and save the changes?

texts: I tried to make some changes to my Magento site by clicking on inspect,but I could not save the changes I made to my website. Do I have to use a web browser and a text editor such as Notepad ++ to make changes and save them? Anyone can help on how to save the changes to my Magento website.


texts: Magento 2 Get all Orders sort by latest orders

texts:
I am using the below Rest api to fetch all orders in desc i.e the latest on top but its not working

index.php/rest/V1/orders?searchCriteria=all&searchCriteria[sortOrders][0][field]=order_id&searchCriteria[sortOrders][0][direction]=ASC


texts: Magento 2.4.2: how to have a provision to enter Canada Province names and postal codes in the shopping cart page

texts:
In the shopping cart, there needs to be a provision to enter Canada Province names and postal codes which are formatted either of two ways:
A2B 3C4   or  A2B3C4.  It's alternating letters and numbers, starting with a letter.
Could you please share links to some documentation around overriding shopping cart template?


texts: Select Product Where Price Is Greater Than Zero

texts:
Given the following code:

$mageProductCollection = Mage::getModel('catalog/product')
                        ->getCollection()
                        ->addAttributeToSelect('*')
                        ->addPriceData()
                        ->addFieldToFilter('status', array('eq' => '1')
                    );

How would I select only those products where price is greater than X? I have tried several things, including the following:

$mageProductCollection = Mage::getModel('catalog/product')
                        ->getCollection()
                        ->addAttributeToSelect('*')
                        ->addPriceData()
                        ->addFieldToFilter('price', array('gt' => '0.00')
                        ->addFieldToFilter('status', array('eq' => '1')
                    );

But I can't figure it out. Thanks for any help.


texts:
How can I display "Out of stock" in the product based on the Warehouse selected.
I will have a selected_opco cookies that can determine the selected source.
How can I display "Out of Stock" based on the selected warehouse, it is currently showing based on the default.


texts: How to know if an order is paid ? When "state" is "processing"?

texts:
I'm running Magento 1.6.2.

I need to determine if an order is paid. If yes, I generate some XML data for export.
There is many cases in the Magento order/payment/shipment workflow.

My first guess is when the attribute "state" of the order is defined as "processing", but I'm not sure because of the large amount of possibilities in this workflow. May be this case is not covering all the possibilities ...

Am I right with that ?


texts: How to rename label Shipping into delivery for order summary in Checkout page in magnento2.1.7?

texts:
I want to rename label (Shipping to delivery) only in order summary in Checkout page in magennto2.1.7 ?

Refer screenshot.


texts: where is filter applied to get product collection

texts:
/app/code/core/Mage/Catalog/Block/Product/List.php

there is a function

protected function _getProductCollection()
{
    if (is_null($this->_productCollection)) {
        $layer = $this->getLayer();
        /* @var $layer Mage_Catalog_Model_Layer */
        if ($this->getShowRootCategory()) {
            $this->setCategoryId(Mage::app()->getStore()->getRootCategoryId());
        }

        // if this is a product view page
        if (Mage::registry('product')) {
            // get collection of categories this product is associated with
            $categories = Mage::registry('product')->getCategoryCollection()
                ->setPage(1, 1)
                ->load();
            // if the product is associated with any category
            if ($categories->count()) {
                // show products from this category
                $this->setCategoryId(current($categories->getIterator()));
            }
        }

        $origCategory = null;
        if ($this->getCategoryId()) {
            $category = Mage::getModel('catalog/category')->load($this->getCategoryId());
            if ($category->getId()) {
                $origCategory = $layer->getCurrentCategory();
                $layer->setCurrentCategory($category);
                $this->addModelTags($category);
            }
        }
        $this->_productCollection = $layer->getProductCollection();

        $this->prepareSortableFieldsByCategory($layer->getCurrentCategory());

        if ($origCategory) {
            $layer->setCurrentCategory($origCategory);
        }
    }

    return $this->_productCollection;
}

It returns the product collection after applying the layered navigation filters.

Anyone could let me know where it is applying the filters.

For example : I have an attribute brand which is shown in layered navigation.

If I select a value for this attribute then Magento refreshes the page and returns the product collection after applying the filter. The above function is returning the product collection but I could not find the query where it is applying this condition.

Anyone could tell me how magento is getting the product collection, where is the query.

So as suggested by @simonthesorcerer

 $this->_productCollection = $layer->getProductCollection();

I looked into the function getProductCollection() and echoed out what was there in the collection. Here is the function

   /**
 * Retrieve current layer product collection
 *
 * @return Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Collection
 */
public function getProductCollection()
{
    if (isset($this->_productCollections[$this->getCurrentCategory()->getId()])) {
        $collection = $this->_productCollections[$this->getCurrentCategory()->getId()];
    } else {
        $collection = $this->getCurrentCategory()->getProductCollection();
        $this->prepareProductCollection($collection);
        $this->_productCollections[$this->getCurrentCategory()->getId()] = $collection;
    }
  echo "<pre>";print_r($collection->getData());die();  //Custom to check collection
    return $collection;
}

I selected a category and got 62 products in collection that was correct and then I selected an attribute filter and again it shows 62 products, means this is not the function which is applying attribute filter to categories.
So anyone could tell me where is the code where attribute filter is applied to the collection. I just want to locate that code.


texts: Magento Product Category still showing after deleting

texts:
I got this really annoying issue with Magento. I attempted to load all my items onto the store but had some bugs. In result, I deleted all my items but I am still showing 57 items in the Category Products and in the URL-Rewrites. I have deleted the categories and subcategories. I have cleared the cash and have re-indexed everything, but still nothing. I need help urgently!

In addition, after uploading and deleting everything I am now getting a FATAL ERROR message if I attempt to export the .csv.

  Fatal error: Unsupported operand types in includes/src/Mage_ImportExport_Model_Export_Entity_Product.php on line 875

Any help would be greatly appreciated


texts: how to fetch swatch images from another folder ( not from swatches folder )

texts:
I have created new attribute color_group. I have added multiple colors to color_group attribute. Now I want to add the color images to that colors.
How can I assign color images to that colors.


texts: magento2: Moved magento to new domain ,all urls redirected to old url

texts:
I'm using Magento 2

We have moved the site from one domain to another and also changed the folder location one IP address to another IP address.

After the change the admin panel is working fine but in then front-end, except for the home page, every page/link is redirecting to the old domain.

Categories and product links are also redirecting to the old domain

I have tried the following :

1)

update core_config_data set value = 'http://newdomain.com/' where path = 'web/unsecure/base_url';
update core_config_data set value = 'http://newdomain.com/' where path = 'web/secure/base_url';

2) Delete sudo rm -rf  var/cache/*, var/page_cache var/view_preprocessed  pub/static/ folder
 After deleting I have run following commands

php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy
php bin/magento indexer:reindex
php bin/magento cache:flush
php bin/magento cache:clean

3)

     SET FOREIGN_KEY_CHECKS=0;
    UPDATE `store` SET store_id = 0 WHERE code='admin';
    UPDATE `store_group` SET group_id = 0 WHERE name='Default';
    UPDATE `store_website` SET website_id = 0 WHERE code='admin';
    UPDATE `customer_group` SET customer_group_id = 0 WHERE        customer_group_code='NOT LOGGED IN';
    SET FOREIGN_KEY_CHECKS=1;


texts: Merge custom collection into customer/address collection

texts:
I'm making an extension, that lets the user define companies and add addresses to them. The plan is to show those addresses to the customer according to the value of an attribute in the customer (eg. Company_Id).
Thanks to the help of R.S I was able to create an observer (eav_collection_abstract_load_before) which is called before the customer/address collection is loaded.

Now at this point I want to add my addresses to the collection, so they're shown on the customer Addressbook page, on checkout etc.

I created a model in the same schema as the customer/address model and tried:

$companyAddress = Mage::getModel('myNamespace_MyModule/companyaddress')->load(1);
$CustomerAddressCollection->addItem($companyAddress);

Here I get the error: Attempt to add invalid object

How can I merge these two collections?


texts:
My inventory is updated frequently via webservices/cron.  My issue is that if a product goes "out of stock", the check box remains "out of stock" even when new inventory is showing up.  For example, a product had a quantity of 0 for a couple of weeks so the "out of stock" box was checked at the backend automatically.  Now the stock levels have updated to 300 and the product will not automatically display at the front without me needing to manually uncheck the "out of stock" box at the back.  With thousands of products in my catalogue and stock levels constantly updating, it's not practical for me to do this.  Can anyone tell me how to have Magento automatically display an item as "in stock" when the inventory is above 1?
Thanks in advance


texts: product attribute not showing in cart price rule after enabling it magento 2.2.2

texts:
After enabling this and assigning it to products for cart rules, I am unable to see it from the drop down in cart rules below

This won't work for any existing or new attribute I create. I can't figure out what might be happening.

I have cleared the cache and reindexed am I am missing something? Has anyone else seen this?

magento 2.2.2


texts: Magento Frontend Dashboard Stuck Loading

texts:
Magento 2.2.5

Attached are screenshots of the errors in Chrome dev tools:

jquery.js

loader.js

Also:

There are some images being requested that are missing from an S3 bucket that are throwing out 403/404 errors. I wouldn’t think that would cause the dashboard to continue loading without any results or timing out.


texts: Can I change my default language from English to German?

texts:
Can you provide a guide for changing store language from English to German?

  Module i18n only has en_Us file.

I have learned a user guide, but cannot understand that.

Any solution for that?


texts: How to move Wishlist next to Add to Cart button?

texts:
I tried,

 <page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
       <move element="view.addto.wishlist" destination="product.info.media" />
 </page>


texts: Ajax add to cart popup: Product method sometimes returns null

texts:
Currently I'm experiencing issues with a third party ajax add to cart popup module. The issue is that, on very rare occasion the get product method will return null, and this causes the following error in the getProductCollection method, as the product collection will return null when the product is null:
report.ERROR: Warning: count(): Parameter must be an array or an object that implements Countable

If I protect against null values by passing an empty array (countable) when the product is null then I see the following error in the getImage method:
Uncaught TypeError: Argument 1 passed to Magento\\Catalog\\Block\\Product\\ImageBuilder::setProduct() must be an instance of Magento\\Catalog\\Model\\Product, null given

It seems to be that the issue is that on rare occasion, the product will return null. The problem is that I'm unable to reproduce this issue. The related error might log once a day, or sometimes once a week. The only way I can reproduce is by explicitly setting the get product method to return null, or by deleting a product and then adding it to cart before refreshing the page. Otherwise, when testing the add to cart popup seems to work perfectly.
One option might be to only load the popup when the product is not null:
if ($this->getProduct() != null)

This prevents any unexpected errors when the product is null, but I'm not quite understanding why the get product method would return null in the first place. Is this normal, and the issue here is the lack of protection against null values?
The mentioned methods are as follows:
getProduct method:
public function getProduct()
{
    if(!$this->_product && $this->getProductId()) {
        $this->_product = $this->_initProduct($this->getProductId());
    }
    return $this->_product;
}

getProductCollection method:
public function getProductCollection() {
    if (!$this->_productCollection && $this->getProduct()) {
        $this->_productCollection = $this->_crosssellBlock->getItemCollection();
    }
    return $this->_productCollection;
}

getImage method:
public function getImage($product, $imageId, $attributes = []) {
        return $this->imageBuilder->setProduct($product)
            ->setImageId($imageId)
            ->setAttributes($attributes)
            ->create();
}

Any help would be appreciated.
Cheers,
Max


texts:
I have a request from client where he wants to put google analytics code on different pages in Magento under footer.

I see that footer is generic, so is there a way to place a different code under footers for pages / create different footers?


texts:
Need Help for Magento 2,
I have cretaed a attribute for category.
I want to display featured catagory list on home page using attribute,please help me for get collection of featured category.


texts:
I'm facing a problem when executing setup:upgrade command. It seems to hang for a very long time on Updating Modules step.
By using strace I can see it's running some queries like

DROP TRIGGER IF EXISTS `trg_catalog_category_entity_after_insert`

which take a long time.
What's the reason it executes the above command, where is it located and how can I speed it up?
Is there perhaps some configuration that needs to be done in MariaDB to speed it up?
Any ideas?


texts: Magento Product Add to Cart after Login for Selected Category

texts:
In Magento, is it possible to add the product to cart after login for the selected category.

The selected category products, which can be view for all user while add this product to cart it should check whether the user is login, if the user is login product should be added to cart else it should go to my account page after user login that product should added to cart and the user also redirect to the cart page.

Any Ideas?
Thanks in advance.


texts: Magento2 I need to display order details in my custom admin grid

texts:
Magento 2 , in my admin grid display order table data.. How to display this?
Can you give my any suggestion please.


texts: Matching CLI Bootstrap Params to pub/index.php's Bootstrap Params

texts:
Magento 2 has, infamously, two index.php files.  The first is in the root folder

index.php

the second is in a pub folder

pub/index.php

A Magento developer needs to chose which file they're going to point to as their webroot.  This creates some problems related to file paths and URL paths.  Magento solves this by bootstrapping index.php like this

$bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $_SERVER);

and bootstrapping pub/index.php like this

$params = $_SERVER;
$params[Bootstrap::INIT_PARAM_FILESYSTEM_DIR_PATHS] = [
    DirectoryList::PUB => [DirectoryList::URL_PATH => ''],
    DirectoryList::MEDIA => [DirectoryList::URL_PATH => 'media'],
    DirectoryList::STATIC_VIEW => [DirectoryList::URL_PATH => 'static'],
    DirectoryList::UPLOAD => [DirectoryList::URL_PATH => 'media/upload'],
];
$bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $params);

i.e. -- Magento adds values to the array that's the second argument to create.

This solution, however, creates another problem.  The Magento CLI also need to bootstrap an enviornment.  It seems to do so here

#File: vendor/magento/framework/Console/Cli.php
$bootstrapParam = new ComplexParameter(self::INPUT_KEY_BOOTSTRAP);
$params = $bootstrapParam->mergeFromArgv($_SERVER, $_SERVER);
$params[Bootstrap::PARAM_REQUIRE_MAINTENANCE] = null;
$bootstrap = Bootstrap::create(BP, $params);

There's (Seemingly?) no opportunity to add additional parameters, which means the CLI console will always think you're running from the main index file, and any code that needs the DirectoryList params may not function correctly.

Is there any way (short of editing Cli.php  directly or replacing it via a composer autoload) to inject these parameters into the CLI bootstrap?  Looking for known solutions, not theories on what might work.  Thank you!


texts: Disable "Use In Search Results Layered Navigation" from the database for specific attribute

texts:
I've got a script that is extracting attributes and inserting them into my Magento installation. The problem is that one of the attributes has created hundreds of duplicate options.

If I set the option Use In Search Results Layered Navigation to NO and hit save, it complains that the admin value needs to be filled in. There are hundreds.

I want to disable this directly from the database so it doesnt show in the frontend and allow me to troubleshoot why this happened.

How do you disable layered navigation for a specific attribute from the database?


texts: Magento 2.2 CE : Change in Vendor not update in cloud

texts:
I changed vendor/magento/module-customer/view/templates/widget/name.phtml "name validation" when i did this change in localhost and ran set:upgrade its working properly.

But not in cloud.Why?

I think its because of vendor folder which is not  updating in cloud.I tried to add custom module also.


texts: How to set email logo as it is Sales email Magento2?

texts: I have created custom email template in which i include header but i get the by default Luma logo instead of which i upload the logo from the backend side how can i got the Uploaded logo in my custom email?


texts: How to add product custom options in cart

texts:
I need add in cart for my products also and custom options, I need  display not only total price but also custom options value with price.

Thanks


texts: How do i get shipping method of current Store : Magento

texts:
I am creating functionality to get Shipping methods enabled for selected store.

Currently I am using below code to get Shipping details :

$methods = Mage::getSingleton('shipping/config')->getActiveCarriers();
$shipMethods = array();

foreach ($methods as $shippigCode=>$shippingModel)
{

    $shippingTitle = Mage::getStoreConfig('carriers/'.$shippigCode.'/title');
    $shippingPrice = Mage::getStoreConfig('carriers/'.$shippigCode.'/price');
    $shippingLabel = Mage::getStoreConfig('carriers/'.$shippigCode.'/label');
    $shipMethods[]=array('Shipping Type' => $shippigCode, 'title'=> $shippingTitle, 'price'=> $shippingPrice);

}
print_r($shipMethods);

I only get config details of the default store.

My question is : How do i get shipping methods of selected store?


texts:
In my server, I am using Nginx and issue which I faced is when we have long data in the email template. while preview that template we get 500 and page is completely broken. In this case, this is not even hitting the magento controller.

Is there some Nginx server configuration is missing, please let me know.


texts:
I have made a search on google but i didn't found a results.
Is there an extension that track user's actions, so we can know which user create an invoice


texts: How to apply free shipping promo code to only one shipping method?

texts:
I think it is a default Magento functionality, when we create a promo code for free shipping it is applying on all the shipping methods and rates for all the shipping methods showing zero.

Is that any way I can apply free shipping on only Flat Rate and other shipping options will show their prices.

My rule setting in admin as below.


texts: Add to cart with ajax not working in homepage

texts:
I installed Magento 2.2.5, and set Luma theme as default. In my homepage add to cart is not working with ajax, while on the other pages works just fine.
Any idea?


texts: How to restict zipcode on checkout form in magento

texts:
I want to restrict all zipcodes except the two zipcodes on checkout form at frontend. So as the user will input any zipcode different above two the order should not be placed.

I found this extension https://www.magentocommerce.com/magento-connect/shipping-restriction.html  It deos not allow specific zipcode that they want to restrict. but I want to restict all zipcodes besides two above.

I am using persistent checkout form. Below is the image of my check out form-

Till now what I was doing that I have applied a jquery blur function on zipcode text input it check zipcode on blur. In this case it works fine but when user use autofills property of browser, it bypass my function and it allow user to checkout with any zipcode so now I want to check zipcode on click event of button Continue.

Can anyone advise me what Can I do ? Is there any observer that is called on click on continue button(above image) in billing information.
Please feel free to ask any question?


texts:
I have developed my custom rest API endpoint. Here is the code

webapi.xml

<?xml version="1.0" ?>
<routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Webapi:etc/webapi.xsd">
<route method="POST" url="/V1/createcustomorder">
    <service class="Demo\CreateOrderApi\Api\CreateCustomOrderManagementInterface" method="postCreateCustomOrder"/>
    <resources>
        <resource ref="Magento_Sales::create"/>
    </resources>
</route>

di.xml

<?xml version="1.0" ?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
  <preference for="Demo\CreateOrderApi\Api\CreateCustomOrderManagementInterface" type="Demo\CreateOrderApi\Model\CreateCustomOrderManagement"/>
</config>

Api/CreateCustomOrderManagementInterface.php

<?php
namespace Demo\CreateOrderApi\Api;

interface CreateCustomOrderManagementInterface
{

/**
 *
 *
 * @param array $orderData[]
 * @return mixed[]
 *
 *
 */
public function postCreateCustomOrder();
}

Model/CreateCustomOrderManagement.php

 <?php
 namespace Demo\CreateOrderApi\Model;

  class CreateCustomOrderManagement implements \Demo\CreateOrderApi\Api\CreateCustomOrderManagementInterface
  {

   /**
   * @return mixed[]
   */
   public function postCreateCustomOrder()
   {
     /**
     --rest of code--
     **/

     $this->response[]['dsal'] = ['estatus' => ['0' => ['codigo' => 400, 'mensaje' => 'my message']]];

   return $this->response;
   }

  }

In my rest client, I'm expecting output like this

 {
    "dsal": {
        "estatus": [
            {
                "codigo": 400,
                "mensaje": "No such entity with customerId = 12"
            }
        ]
    }
 }

but Magento gives me output with extra braces

[
 {
    "dsal": {
        "estatus": [
            {
                "codigo": 400,
                "mensaje": "No such entity with customerId = 12"
            }
        ]
    }
 }

]

Can anybody tell me what wrong with return type and return array in my code?


texts: getting Please enter a valid credit card type number error Authorize.Net

texts:
I have used Authorize.Net Credit Card Payment Method,
suddenly it gives an error when entering the credit card number,
Please enter a valid credit card type number
I have found this text in files its giving path like,
app/design/frontend/Theme/default/Magento_Payment/web/js/model/credit-card-validation/validator.js

vendor/magento/module-payment/view/base/web/js/model/credit-card-validation/validator.js

I don't know how to fix this issue,
Please help me on this.
Thanks.


texts: Magento 2: How to terminate other admin session in backend?

texts: How to terminate other administrator session in back-end


texts: Registration custom field not showing in personal information

texts:
In magento 2.3, I have created custom field(GST number) on registration form. This field's value is saving on DB as. This field's value is showing/editing on admin panel(customer edit). But not showing in customer's account information tab. As i try to update first or last name and click on save button then hey show validation message:

GST number is required value

.
There is my script:
<?php
namespace Test\Customer\Setup;

use Magento\Customer\Model\Customer;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\ModuleDataSetupInterface;

class InstallData implements \Magento\Framework\Setup\InstallDataInterface
{
    private $eavSetupFactory;

    private $eavConfig;

    private $attributeResource;

    public function __construct(
        \Magento\Eav\Setup\EavSetupFactory $eavSetupFactory,
        \Magento\Eav\Model\Config $eavConfig,
        \Magento\Customer\Model\ResourceModel\Attribute $attributeResource
    ) {
        $this->eavSetupFactory = $eavSetupFactory;
        $this->eavConfig = $eavConfig;
        $this->attributeResource = $attributeResource;
    }

    public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
    {
        $eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);

        $eavSetup->removeAttribute(Customer::ENTITY, "gst_number");

        $attributeSetId = $eavSetup->getDefaultAttributeSetId(Customer::ENTITY);
        $attributeGroupId = $eavSetup->getDefaultAttributeGroupId(Customer::ENTITY);

        $eavSetup->addAttribute(Customer::ENTITY, 'gst_number', [
            // Attribute parameters
            'type' => 'varchar',
            'label' => 'GST number',
            'input' => 'text',
            'required' => true,
            'visible' => true,
            'user_defined' => true,
            'sort_order' => 990,
            'position' => 990,
            'system' => 0,
        ]);

        $attribute = $this->eavConfig->getAttribute(Customer::ENTITY, 'gst_number');
        $attribute->setData('attribute_set_id', $attributeSetId);
        $attribute->setData('attribute_group_id', $attributeGroupId);

        $attribute->setData('used_in_forms', [
            'adminhtml_customer',
            'customer_account_create',
            'customer_account_edit'
        ]);

        $this->attributeResource->save($attribute);
    }
}
?>


texts: Magento 2 : How to override product detail page in custom module

texts:
I want to override product detail page in custom extension for all types of product. I need some changes around below area

Any One know about this, please guide me


texts:
I added following codes in my app\code\local\Svi\Form\sql\form_setup\mysql4-install-0.1.0.php

<?php
$installer = $this;
$installer->startSetup();
$installer->run("
-- DROP TABLE IF EXISTS {$this->getTable('svi_form')};
CREATE TABLE {$this->getTable('svi_form')} (
  `form_id` int(11) unsigned NOT NULL auto_increment,
  `fname` varchar(255) NOT NULL default '',
  `lname` varchar(255) NOT NULL default '',
  `fathername` varchar(255) NOT NULL default '',
  `mothername` varchar(255) NOT NULL default '',
  `mobile` bigint(10) NOT NULL default '0',
  PRIMARY KEY (`form_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
    ") or die("error in local/svi/form/sql folder.....");

 //Add new column to the 'svi_form' table

        $installer->getConnection()->addColumn(
        $this->getTable('svi/form'), //table name
        'address' 'varchar(255) NOT NULL DEFAULT '''  //'column name'

//datatype definition

        );

$installer->endSetup();

app\code\local\Svi\Form\etc\config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Svi_Form>
            <version>0.1.0</version>
        </Svi_Form>
    </modules>
    <frontend>
        <routers>
            <form>
                <use>standard</use>
                <args>
                    <module>Svi_Form</module>
                    <frontName>form</frontName>
                </args>
            </form>
        </routers>
        <layout>
            <updates>
                <form>
                    <file>form.xml</file>
                </form>
            </updates>
        </layout>
    </frontend>
    <global>
        <models>
            <form>
                <class>Svi_Form_Model</class>
                <resourceModel>form_mysql4</resourceModel>
            </form>
            <form_mysql4>
                <class>Svi_Form_Model_Mysql4</class>
                <entities>
                    <form>

svi_form

                    </form>
                </entities>
            </form_mysql4>
        </models>
        <resources>
            <form_setup>
                <setup>
                    <module>Svi_Form</module>
                </setup>
                <connection>
                    <use>core_setup</use>
                </connection>
            </form_setup>
            <form_write>
                <connection>
                    <use>core_write</use>
                </connection>
            </form_write>
            <form_read>
                <connection>
                    <use>core_read</use>
                </connection>
            </form_read>
        </resources>
        <blocks>
            <form>
                <class>Svi_Form_Block</class>
            </form>
        </blocks>
        <helpers>
            <form>
                <class>Svi_Form_Helper</class>
            </form>
        </helpers>
    </global>
</config>

But it is not working. What to do?


texts: what is the maximum length for meta_keyword, meta_description and meta_title

texts:
While Uploading CSV,

There are some constraints that we have to follow, Like lengths of the attributes :

Please Provide the length of following attributes:

"meta_keyword"

"meta_title"

"meta_description"

Attribute Reference from : Magento Go - Knowledge Base


texts: Catalog price rules are not working if I had the dates in the rules.

texts: I am building an e-commerce website named bookslab.in. I had added the catalog price rule of 10% OFF, but it is not getting visible on frontend. I had tried a lot, change dates, tried different types of conditions but still it is not visible.  I had used Simple product as Attribute Set for all products on my website. I had added the condition on all my books.  I had cleared the cache & done re-index as well. I had kept the priority "0". Any help will be appreciated. I had click on Apply rules as well.


texts: Create an order in admin panel with a new product type

texts:
I created a new product type like "License Product" extend from "Virtual Product".
I can place an order with this product type in frontend, but i can't add this product to order in backend.

Any help will be appreciated.

This is my code:

Setup/InstallData.php

class InstallData implements InstallDataInterface
{
    private $eavSetupFactory;

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

    public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
    {
        $eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);

        $fieldList = [
            'price',
            'special_price',
            'special_from_date',
            'special_to_date',
            'minimal_price',
            'cost',
            'tier_price',
            'weight',
        ];

        foreach ($fieldList as $field) {
            $applyTo = explode(
               ',',
               $eavSetup->getAttribute(\Magento\Catalog\Model\Product::ENTITY, $field, 'apply_to')
        );
        if (!in_array('license', $applyTo)) {
            $applyTo[] = 'license';
            $eavSetup->updateAttribute(
                \Magento\Catalog\Model\Product::ENTITY,
                $field,
                'apply_to',
                implode(',', $applyTo)
            );
        }
    }
  }
}

etc/product_types.xml

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Catalog:etc/product_types.xsd">
<type name="license" label="License Product" modelInstance="Demo\ProductType\Model\Product\Type\License"
      composite="false" isQty="true" canUseQtyDecimals="false" sortOrder="70">
    <priceModel instance="Demo\ProductType\Model\Product\Type\Price"/>
    <customAttributes>
        <attribute name="refundable" value="true"/>
        <attribute name="is_real_product" value="false"/>
    </customAttributes>
</type>


texts: Search Term Redirect URL. Relative Path instead of Full URL Path?

texts:
When editing a Search Query, why doesn't Magento allow the Redirect URL to be Relative Paths like /section/subsection or /best-product. It enforces the full URL which is kind of pain. How would you change this and is there any reasons to consider not changing this?

Magento Documents its Search Term Redirect Functionality.


texts: Item out of stock in admin - in stock on frontend

texts:
Admin: Catalog > Manage products
  Choose a product: inventory
  - Qty = 0
  - Qty for Item's Status to Become Out of Stock = 0
  - Stock availability: in stock

A similar setting in the config:

Admin: System > Configuration
  Inventory: Qty for Item's Status to Become Out of Stock = 0

So a given product has no items in stock, and when there are no items in stock, it should display as "Out of stock" on the frontend. For some reason this doesn't happen and the item stays "in stock".

How can I fix this?


texts:
I removed the main "admin" module permission for my admin user from Magento backend. After the changes were saved, the entire admin page now shows "access denied".

How can I fix this?


texts: Add editable text input to creditmemo totals

texts:
How to change the -€5.00 simple text to a text input field (editable) ?

This is how I add the totals:

<?php
namespace My\Discount\Block\Adminhtml\Sales\Order;

class Totals extends \Magento\Framework\View\Element\Template
{
  public function initTotals()
  {
    $parentBlock = $this->getParentBlock();
    $order = $parentBlock->getOrder();
    $source = $parentBlock->getSource();

    $amount = $order->getData("discount_amount"); // custom field

    if (isset($amount)) {
      $total = new \Magento\Framework\DataObject([
        'code' => 'customdiscount',
        'value' => -$amount,
        'label' => "Custom Discount"
      ]);

      $parentBlock->addTotal($total, 'customdiscount');
    }

    return $this;
  }
}

  /view/adminhtml/layout/sales_order_creditmemo_new.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="creditmemo_totals">
            <block class="My\Discount\Block\Adminhtml\Sales\Order\Totals"
                   name="customdiscount" />
        </referenceBlock>
    </body>
</page>


texts: How to override a HTML file using a custom module?

texts:
I'm developing a custom module for payment method in Magento 2. Currently, I'm using cc-form.html from vendor directory and module working fine. See below path:

  vendor/magento/module-payment/view/frontend/web/template/payment/cc-form.html

Is there any way to override HTML file?

Note: I would like to override it using a custom extension.
See below path:

  app/code/Namespace/Module/view/frontend/web/template/payment/cc-form.html

Any help would be appreciated. Thank you!


texts: Category url different in newly created storeview!

texts:
I have a store-view for the Hebrew language. In which, category URL using the suffix .html.

for example- http://www.example.com/store/index.php/language/category.html

Now, I have created new store-view for another language In which category URL are not the same, default category URL(with category id) is using in newly created store-view.

for example- http://www.example.com/store/index.php/new_language/catalog/category/view/s/cream-filled-desserts/id/153/

How can I add the same category URL with .html suffix for newly created store-view.

I am using magento 1.9.0.1


texts:
I am trying to update quantity on cart page but not updated.

Please help me how to solve this issue ?


texts: I need to remove all parts using objectManager In my Magento 2.2.3 project

texts:
Because of lack of knowledge, I currently have many parts using objectManager in my project.But I'm not sure whether I should create a module and create many functions for these various parts running by objectManager.
For example, in app/design/frontend/CustomTheme/default/Magento_Catalog/templates/product/list.phtml, I'm using 4 different results just using objectManager.

$_product = $objectManager->create('Magento\Catalog\Model\Product')->load($_item->getId());

$storeManager = $objectManager->get('\Magento\Store\Model\StoreManagerInterface');

$cartlist = $objectManager->create('\Magento\Checkout\Model\Cart')->getQuote();

$context = $ObjectManager->get('Magento\Framework\App\Http\Context');

If I create a module and a Block, is it okay to add 4 different functions in just one Block?
In other files, I am going to use this Block class to remove the parts running by objectManager.


texts: How to capture creditcard payment using sales order REST API magento 2?

texts:
How to create sales order with payflow pro payment using REST api magento 2.

Order placed successfully with sales order api but payment doesn't not set using order api.

I want to pass test credit card info in order to check how payment are capture using api.

Just test with VISA Test credit card

Credit card number 4111111111111111
Expiry Month year 01/20

  Payment method is payflowpro.

Request:

http://{websiteurl}/index.php/rest/V1/orders/

I am using salesOrderRepositoryV1 API for place order using api from swagger Sales Order Using Rest API.

Below is the structure of payment method in api,

"payment": {
      "account_status": "string",
      "additional_data": "string",
      "additional_information": [
        "string"
      ],
      "address_status": "string",
      "amount_authorized": 0,
      "amount_canceled": 0,
      "amount_ordered": 0,
      "amount_paid": 0,
      "amount_refunded": 0,
      "anet_trans_method": "string",
      "base_amount_authorized": 0,
      "base_amount_canceled": 0,
      "base_amount_ordered": 0,
      "base_amount_paid": 0,
      "base_amount_paid_online": 0,
      "base_amount_refunded": 0,
      "base_amount_refunded_online": 0,
      "base_shipping_amount": 0,
      "base_shipping_captured": 0,
      "base_shipping_refunded": 0,
      "cc_approval": "string",
      "cc_avs_status": "string",
      "cc_cid_status": "string",
      "cc_debug_request_body": "string",
      "cc_debug_response_body": "string",
      "cc_debug_response_serialized": "string",
      "cc_exp_month": "string",
      "cc_exp_year": "string",
      "cc_last4": "string",
      "cc_number_enc": "string",
      "cc_owner": "string",
      "cc_secure_verify": "string",
      "cc_ss_issue": "string",
      "cc_ss_start_month": "string",
      "cc_ss_start_year": "string",
      "cc_status": "string",
      "cc_status_description": "string",
      "cc_trans_id": "string",
      "cc_type": "string",
      "echeck_account_name": "string",
      "echeck_account_type": "string",
      "echeck_bank_name": "string",
      "echeck_routing_number": "string",
      "echeck_type": "string",
      "entity_id": 0,
      "last_trans_id": "string",
      "method": "string",
      "parent_id": 0,
      "po_number": "string",
      "protection_eligibility": "string",
      "quote_payment_id": 0,
      "shipping_amount": 0,
      "shipping_captured": 0,
      "shipping_refunded": 0,
      "extension_attributes": {
        "vault_payment_token": {
          "entity_id": 0,
          "customer_id": 0,
          "public_hash": "string",
          "payment_method_code": "string",
          "type": "string",
          "created_at": "string",
          "expires_at": "string",
          "gateway_token": "string",
          "token_details": "string",
          "is_active": true,
          "is_visible": true
        }
      }
    }

How to set credit card info in above structure to place order using Paypal.

How to place order using credit card data?