texts: Magento 2 has NULL value for customer_id in the quotes table, even after the customer is logged in. Causing error "cartId is a required field"

texts:
In a Magento 2 store, the checkout breaks when the user successfully logs in. When the user logs in and enters their address info, they receive no shipping quotes, and an error pops up saying "cartId is a required field".

The error is actually misleading: The underlying problem (discovered using xdebug) is that the quote table row for their cart is missing a customer_id. Instead, it has a NULL value for this field.

This means that:

Magento calls this function

  Magento\Quote\Model\ResourceModel\Quote::loadByCustomerId($quote, $customerId)

  * For the purpose of this example, $customerId = 1;

Which runs a query:

  SELECT `quote`.*
  FROM   `quote`
  WHERE  ( `quote`.`customer_id` = 1 )
     AND ( store_id IN ( '1' ) )
     AND ( is_active = 1 )
  ORDER  BY `updated_at` DESC
  LIMIT  1

Of course, nothing is found, so an exception is thrown. The actual error is masked by a catch-all that does nothing -- the same one described in GitHub Issue #9744

    } catch (NoSuchEntityException $e) {
        /* do nothing and just return null */
    }

So my question is: Why would the quote not have a customer_id for the quote that the customer had created when adding products to the cart? The products still show up in the right sidebar, so the quote is still attached to their session, but for whatever reason, it lacks their customer_id after they log in.


texts:
My website is lightning fast (loads under 1 second) using different AJAX and Caching extensions, but all grinds to a complete stop when checking out. Load times can jump up to around 10 seconds, sometimes even more. Even refreshing /checkout/onepage/ can take forever.

I know this issue probably depends on numerous things, but let me begin by asking how I would be able to narrow down the causes. Is there some debugging mode available that can tell me what exactly is being loaded while waiting?


texts: How to get admin order items from admin order quote

texts:
I'm trying to get the items which are present in quote of admin order.

\Magento\Backend\Model\Session\Quote $adminQuote
\Magento\Sales\Model\AdminOrder\Create $adminCreate

to get the details but whenever i call call getItems, getAllvisibleItems, getAllItems its returning null value.

I need to get the item details which are under quote when you are placing an order from admin.
Can any one let me know how to do that.


texts: Magento2: How to set a "deal of the day" for a configurable product

texts:
I can set the deal of the day for a simple product and everything works fine.

1)

2) but how to set deal of the day for configurable product?
- in main configurable product impossible to edit price:

When I try edit price in each size for this configurable product then no work.


texts: Load jQuery in admin panel programmatically

texts:
I want to load jQuery in admin panel. How can I do this programmatically without creating layout XML files in /app/design/adminhtml/default/default/layout/? Method with layout XML is described in this thread: https://stackoverflow.com/questions/12799838/how-to-load-a-js-file-on-magento-admin-dashboard

Is there any way to do this programmatically in my custom module?
The module adds some new form fields which can be used on admin pages under System->Configuration. And there I need jQuery to be loaded.

EDIT

In my module I have this custom field in which I need to use jQuery:

class Company_Helloworld_Block_Adminhtml_Mybutton extends Mage_Adminhtml_Block_System_Config_Form_Field
{
    protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
    {
        //...here add some custom button functionality
    }
}


texts:
I'm very new to Magento and am trying to figure out/setup a search API for the products in our catalog for an external site.

How do I enable the API in Magento to be able to call GET /api/rest/products?q=hat, which would return all hats in our list of products?

Another example, GET /api/rest/products?q=shoes, which would return all shoes in our list of products.


texts:
I want a new custom block to get all option values to a given filter product attribute in Magento_LayeredNavigation::layer/view.phtml.

We have our own design folder which overrides the default layout:

Now i want to modify this view.phtml with a new Block which we build in a custom module:

<?php

namespace MyVendor\MyNamespace\Block\Catalog;

class AttributeOptions extends \Magento\Framework\View\Element\Template
{
    public function __construct(\Magento\Framework\View\Element\Template\Context $context)
    {
        parent::__construct($context);
    }

    public function getOptions()
    {
        $aReturnValues = array('A', 'B');
        return $aReturnValues;
    }
}

In our module we add this:

app\code\MyVendor\MyNamespace\view\frontend\layout\catalog_category_layered.xml

With:

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <referenceContainer name="sidebar.main">
        <block class="MyVendor\MyNamespace\Block\Catalog\AttributeOptions"/>
    </referenceContainer>
</page>

Than we edit the view.phtml and and this:

We activate the whole module but we get an

  Exception #0 (Magento\Framework\Exception\LocalizedException): Invalid
  method exception.

Can anyone tell us the correct way to modify a phtml with a new block which has no own template?


texts: How do I save dynamic price from frontend for the same product to have 2 products in cart

texts:
I'm using Observer.php

public function updateProductPrice(Varien_Event_Observer $observer){
    $quote = Mage::getModel('checkout/cart')->getQuote();
    $allItems = $quote ->getAllItems();

    foreach($allItems as $itemE){
         if($v == $count_itms){
            $itemE->setSku($itemE->getSku(). '_' .$this->hash());
            $itemE->setPrice($price);
            $itemE->setCustomPrice($price);
            $itemE->setOriginalCustomPrice($price);
            Mage::log('** THIS PRICE FROM '.$price);
            $itemE->getProduct()->setIsSuperMode(true);
            $itemE->save();
            $quote->save();
        }
    }
}

public function hash(){
    generated_hash_code = '34drfedE';
    return generated_hash_code;
}

Firs time I get the price, for the current sku I changed the sku appending some hash at the end.
I save the cart also the session (checkout/session), (checkout/cart) is working.
BUT the second time when I'm trying to insert a new product(the same product) with the same sku but with different price the session and the cart are not changed.

Questions:

the information on cart that are displayed from where are toked. (to now where i should save);
difference between:  getModel('checkout/cart') and helper('checkout/cart') ?
where is calculated the price in cartcontroller ?
To find another solution ... I can create a new product (custom product with this price, different sku, different id ).
How can I overwrite cartcontroller? ...some xml?
Thx.


texts: How to display Name, Thumbnail Image, Price, Add-to-cart Button On CMS PAGE?

texts:
I need to display all my products like,

Sku    Name Price    Thumbnail      Add-to-cart(Button)

How can i get all above details on CMS Page?

Note : Add-To-Cart Error


texts: M2: customer address increment_id column

texts: There's a column called increment_id in customer_address_entity. Is this used for anything?


texts:
Please explain what is the meaning of this statement in Magento
$this->_redirect('*/*/');


texts: Links not working for multiple website under having multiple stores

texts:
For last 2 days i am trying to make two website with different multistore, all the method i follow is correct and i got multiwebsite with multi stores but problem is that only home page is running fine, inner pages like category and product listing pages not working properly .
And i can not add different price for different view stores .
please help me: thanks in advance

in second screen shot i create a store view.!


texts: Adding product photos in Email a Friend in Magento 2

texts:
I modified the product_share.html and added this

<img src="{{var product_image}}“ border="0" />

before

  {{var product_name}}

The email contains has the image box but no product image only the Magento watermark.

what do you think I am missing??


texts: Magento-1.9: How to manage products as per my wish in owl corousel slider for my home page slider?

texts:
I'm trying to set up a category products list on my homepage following this tutorial.

    {{block type="filterproducts/featured_home_list" name="new_list" product_count="10" category_id="3" aspect_ratio="1" lazy_owl="1" template="filterproducts/list.phtml"}}

with below script

The above slider works fine for my home page, but it only displays first 10 products for the mentioned category. I want to manage the products randomly as per sku. Whichever product's SKU I specify in the code that products only should be displayed in the slider, instead of first 10/20 products of category.
Is there any method to do that in Magento 1.9?


texts: Method to Update Category Attribute Without Loading the Category Model

texts:
When updating product attributes, this method would suffice so that it would prevent loading the whole product model:

Mage::getSingleton('catalog/product_action')->updateAttributes(
    array(1,2,3),
    array('some_attribute'=>'some value',
          'some_attribute_2'=>'some value',
         ),
    0
);

Is there a function related to this to update the category attribute?


texts: Submit form values using controller and model in magento frontend module

texts:
I am building an module and need to process a form but am having troubles getting the variables to POST and am just redirected to the same page. The form looks like this :

    <form id="orderapproval-item-form" class="orderapproval-hidden" action="<?php echo $this->getUrl('orderapproval/customercart/remarksdecline');?>" method="post">
  <?php echo $this->getBlockHtml('formkey'); ?>
    <input type="text" name="message" class="orderapproval-disabled" value="<?php echo $this->__('Enter decline reason'); ?>" />
    <input type="submit" value="<?php echo $this->__('Decline'); ?>" />
  </form>

i have controller

    public function remarksdeclineAction()
{

              $message = $this->getRequest()->getParam('message');

              echo $message;
          echo "hi";
           exit();
    }

now how to insert form value in table. anyone can help me


texts:
In Magento 2.3.0,i am getting error in console of checkout page.
Issue is attached in screenshot url.

Please help me if anyone face issue like this.

Thank you


texts: how can use weight attribute for different weight

texts:
I am seeking 2 answers from various Magento forum since last 1 week, but not getting any reply. Don't know why, maybe my question is absurd or foolish, but at least I shall know I am wrong. I hope somebody will show me right way of possibilities.

I have 2 questions:
1. What is the use of Weight Attribute, we get while adding/editing Product.
And where it affect in store. Can I use this any way to calculate the price of products?

Just need suggestion what will be the right way to handle following scenario;

Product Name-Tomato
Different available Weights:
100g is of $10.75,
200g is of $21.50,
250g is of $32.25 and
500g is of $53.75

And Qty may be 1,2,3,4,5,6,7,8,9,10 up to 20.

So, Now if buyer buy 3 Qty of 500g then the calculation will be $53.75 x 3 = $161.25 and this amount should display on product detail page (when buyer select his/her requirement) and in cart page.

My doubt is How I will set 4 different weights in 1 single Wight Attribute Text Box.

i also would like to describe that can we add the suggestion on checkout page that so customer can add more product in other product aswell .help would be highly appreciated .....thanks


texts:
When I'm logging that time it redirects to the homepage but I don't want this.

I want to redirect that page in My account dashboard page.

  In configuration
  System > Config > Customer > Customer Configuration > Login option > Redirect Customer to Account Dashboard after Logging is
  set as Yes. It is set to yes on all scopes

I don't know why this redirect to the homepage.

How to redirect page to my account.

How can I do this?


texts:
I have create an owl carousel with code below

$('.owl-carousel').owlCarousel({
                "items" : 1,
                "responsive": false,
                "autoPlay": 2000,
                "loop": false,
                "rewind": false,
                "nav": true,
                "navText": ["<", ">"],
                "dots": true
            });

and this is output html:

when I change to mobile mode. I destroy the owl carousel with code below:

$('.owl-carousel').trigger('destroy.owl.carousel');

But it is not destroy. Is there any wrong in my code? or what is the correct way to destroy owl carousel?


texts:
I am working in a custom module, using which I want to add some custom attributes in my custom tab. By following through lot of tutorials I made custom attribute and successfully output it in one of the default  tab in customer section in admin. Now I  want to display it in my custom tab..

However I need some clarification on custom attributes for doing this. following is my customer attribute details that I forcefully printed in admin side...

Array
(
[attribute_id] => 961
[entity_type_id] => 1
[attribute_code] => nick_name
[attribute_model] =>
[backend_model] =>
[backend_type] => varchar
[backend_table] =>
[frontend_model] =>
[frontend_input] => text
[frontend_label] => Nick Name
[frontend_class] =>
[source_model] =>
[is_required] => 0
[is_user_defined] => 1
[default_value] =>
[is_unique] => 0
[note] =>
[is_visible] => 1
[input_filter] =>
[multiline_count] => 0
[validate_rules] =>
[is_system] => 1
[sort_order] => 100
[data_model] =>
[entity_type] => Mage_Eav_Model_Entity_Type Object
    (
        [_attributes:protected] =>
        [_attributesBySet:protected] => Array
            (
            )

        [_sets:protected] =>
        [_eventPrefix:protected] => core_abstract
        [_eventObject:protected] => object
        [_resourceName:protected] => eav/entity_type
        [_resource:protected] =>
        [_resourceCollectionName:protected] => eav/entity_type_collection
        [_cacheTag:protected] =>
        [_dataSaveAllowed:protected] => 1
        [_isObjectNew:protected] =>
        [_data:protected] => Array
            (
                [entity_type_id] => 1
                [entity_type_code] => customer
                [entity_model] => customer/customer
                [attribute_model] => customer/attribute
                [entity_table] => customer/entity
                [value_table_prefix] =>
                [entity_id_field] =>
                [is_data_sharing] => 1
                [data_sharing_key] => default
                [default_attribute_set_id] => 1
                [increment_model] => eav/entity_increment_numeric
                [increment_per_store] => 0
                [increment_pad_length] => 8
                [increment_pad_char] => 0
                [additional_attribute_table] => customer/eav_attribute
                [entity_attribute_collection] => customer/attribute_collection
            )

        [_hasDataChanges:protected] => 1
        [_origData:protected] =>
        [_idFieldName:protected] => entity_type_id
        [_isDeleted:protected] =>
        [_oldFieldsMap:protected] => Array
            (
            )

        [_syncFieldsMap:protected] => Array
            (
            )

    )

 )

My questions are

1) How can I display this custom attribute in my custom tab? For example:

if (version_compare(Mage::getVersion(), '1.4.2', '>='))
{
Mage::getSingleton('eav/config')
    ->getAttribute('customer', 'nick_name')
    ->setData('used_in_forms', array('adminhtml_customer','mysite_custmernewtab',))
    ->save();
}

where mysite_customernewtab is my module. Whether this method automatically print input field in my custom module? or is it necessary that I want to load this field manually through custom phtml file?

2)I have seen frontend_label,frontend_input datas in the output. Whether it can be used to print input field in admin side? or is there backend_input, backend_label exist similar to this ?

3)what is this source and backend  data? I have seen these items when add an attribute through set up file..

Please help me to understand this... It will help others also.. Thanks in advance


texts: Magento filter for sort by Most reviews on category page

texts:
I have a requirement where I need to create a filter on catalog page for filtering products based on most reviews. I want to add it to Sort by filters on category product list page.

Help me guys please I am under a huge pressure.


texts: Magento 2.2 deprecated module \Magento\Backend\Block\

texts:
As far as I read about magento's documentation I can't find how all that deprecated content will be replaced. The only information is also displayed in each deprecated class of this module ( \Magento\Backend\Block\ )

/**
 * Backend grid item renderer
 *
 * @api
 * @deprecated 100.2.0 in favour of UI component implementation
 * @since 100.0.2
 */

Where can I find how these classes will be treaded? forn now my only source is:
http://devdocs.magento.com/guides/v2.2/ui_comp_guide/best-practices/semantic_config.html

In which it say that there it will be a new book but not sure if is already out. I have a Huge module in adminhtml where is displayed all my admin contentn and need to know if there are out there some content to know how to modify all those classes, or should I wait a little more, for upcoming (release maybe?) information from Magento's team

Also if the idea is not cleared with this, here is the deprecated content/classes
https://github.com/magento/magento2/tree/2.2-develop/app/code/Magento/Backend/Block

Hope you can give me some light here!


texts: “AddThis” Sharing Button : How to change from Http to Https

texts:
I'm working on Magento 1.9.2 with AddThis Social Sharing, I had inserted and changed URL from http tp https on our magento site. But it still display http on src:

<script type="text/javascript" src="http://s7.addthis.com/js/300/addthis_widget.js#pubid="></script>

I want to change http to https on this src. Please kindly help me.


texts: What is the best way to resolve di conflicts in Magento 2?

texts: It's pretty easy to replace a class in Magento 2 using dependency injection. However, let's say I have two modules that want to replace the same class. For example, the dotmailer Magento2 extension sets a preference for Magento\Customer\Model\AccountManagement but my own team's modules already override that class with one of our own. How do we resolve this conflict?


texts: How to display customised banners in Product category landing pages

texts: I wish to create my own banners for the category pages . How to dispaly them ?


texts: Can't save custom data to "sales_order" table

texts:
I'm running Mage 1.4.0.1.

With a mysql setup script, I have created a new column "asyncupload_validated" (tinyint(1) not null default 0) to the "sales_order" table.

I try to set this data to 1 and save it.

Here is my code, who doesn't work currently :

$order = Mage::getModel("sales/order")->load($_POST["order_id"]);
$order->setAsyncuploadValidated(1);
$order->save();
echo "<p>".$this->__("Your files are now validated.")."</p>";

The code is called (tested with some Mage::log) and the POST var is ok. It seems to be the save() param who is failing.


texts: done a ton of searching, found some similar issues but nothing that could lead me to a solution.  I'm running the Magetique theme on Magento 2.3.  On my homepage, I have 2 of the Featured Products widgets with manual products.  I'm getting some strange whitespace and a line above these widgets.  I'm trying to figure out how to remove them because it adds some wasted space on the page that really breaks the flow.  Any advice?


texts: How to add new columns to my orders' dashboard?

texts:
I'd like that in my orders dashboard (attached) I'd have one extra column informing which 'discount cupom' was used in that order (if any).

In the attached file you can see how my orders' dashboard looks like in the moment. Although it's not in english you can figure out what I'm talking about. Can I add another column in there? How so?

I'm running version 1.9.0.1.

Thanks a million!

Cheers

Lelo


texts: How to redirect cart page from checkout onepage when product out of stock ?

texts: I add to cart p1 product when I come checkout onepage that time If another customer buy p1 product and product is out of stock and when I click to continue button as register it is redirecting checkout cart page because of product is out of stock. So where is checkout/cart redirected code in core files when I stay on checkout/onepage and click continue and product out of stock ?


texts: What is the preferred structure of a Magento 2 project under VCS?

texts:
When I start a new M2 project, the first thing I would do is to install the core via composer:

composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition

I can now write my custom module(s) and theme(s) under app/code. I would then add my composer.* and the whole app/code folder to my VCS. So far everything is fine.

Suppose now I want to use some build tools for my project, let's say Grunt or Gulp.

If I commit my own Gruntfile.js, this will be overwritten by the magento/magento2-base package when I run composer install after I cloned the repo.
If I commit my gulpfile.js, I can't really define my dependencies in a package.json, because it would also be overwritten by magento/magento2-base.
If I decide to use Magento's Grunt setup and want to customise it by editing the files under /dev/tools/grunt (e.g. themes.js), I can't because my changes would be overwritten by magento/magento2-base.

My understanding is that you can't really do much in your document root. There are of course plenty of solutions to this problem:

I could run a git checkout - right after installation to reset my own files
I could store my build files in a dedicated folder, /build for example
I could use a different build tool, like Phing, Ant, or Rake (my frontend devs wouldn't be so happy though)
I could replace magento/magento2-base with a custom package that has a custom mapping for core files (not really optimal but hey, it's an option)

I personally dislike all of these options, so I would like to know if there is a preferred or better way to achieve what I'm trying to do.

Is anyone having the same problem? How did you solve it? How do you structure your project under VCS?

UPDATE

An extra point related to the project setup. In my experiments I noticed that Magento composer installer has a flag for file overriding:

"extra": {
    "magento-force": "override"
}

It is internally treated as a boolean if I'm not mistaken, so I tried to set it to false to skip overriding. When I run composer install my installation fails because of the file(s) being already present. Basically, if I don't let Magento override my files, I can't install it.

What is the purpose of this flag then? Is it only suppose to perform a check for me? It doesn't make much sense to me to be honest, but maybe someone can shed some light on the subject.


texts:
I have added a one schedule task for reindexing. I have used the same code given here. But whenever I added this module in scheduler it gives error like

  Invalid callback: Model for Vendorname_Indexer/cron::run does not
  exist

I have tried different variations also like without vendorname but its not working. I am using aoe_schedular to added this.

Please let me know the correct  method to add a schedular in Run model tab.


texts: Getting the error while viewing the order in admin Call to a member function getMethodInstance() on boolean

texts:
I am getting the below error while opening/viewing admin -> sales -> order -> view.

  Call to a member function getMethodInstance() on boolean in
  /var/www/magento/app/code/core/Mage/Payment/Model/Observer.php on line
  46

This error is causing for orders, those are having the order total is Zero means No Payment Information Required.

We are using Magento ver. 1.13.1.0.

Any help would be appreciated.


texts: Need to add a guest checkout button in authentication popup magneto 2

texts: Currently when guest checkout is disable in magento then authentication popup come. But I need there button as well for guest checkout.Please refer a attached screen shot.


texts:
I'm getting below errors during new customer registration and during using contact us form:

  We can't process your request right now. Sorry, that's all we know.

  We can't save the customer.


texts:
I need to create a user account using social network via the API.

I have created via native iOS application that hooks into magento 2 store API. However, I can not find a way to create an account using any of social extensions.
They add buttons however they do not expose any functionality over rest API for creating accounts or login.


texts: How to add the WYSIWYG editor in customer form in admin area

texts:
i create a custom attribute in customer form,that is textarea, in that i need to add the WYSIWYG editor.

your suggestion and idea will help me more


texts: How to send transactional mail with pdf attachment in magento 2

texts:
How can i send transactional mail with pdf attachment in magento 2?
below is my code:

class Post extends \Magento\Framework\App\Action\Action
{
     protected $_objectManager;
     private $_transportBuilder;

    public function __construct(
        \Magento\Backend\App\Action\Context $context,
       \Magento\Framework\ObjectManagerInterface $objectManager,
       \Magento\Framework\Mail\Template\TransportBuilder $transportBuilder,
       \Magento\Framework\Escaper $escaper
    ) {
         $this->_objectManager = $objectManager;
         $this->_transportBuilder = $transportBuilder;
        parent::__construct($context,$objectManager);
    }
    public function execute()
    {

        $this->_view->loadLayout();
        $post = $this->getRequest()->getPostValue();
        $model = $this->_objectManager->create('Zalw\Catalogue\Model\Catalogue');
        $name = isset($post['name']) ? $post['name'] : '';
        $address = isset($post['streetaddress']) ? $post['streetaddress'] : '';
        $radio = isset($post['catradio']) ? $post['catradio'] : '';
        $city = isset($post['catcity']) ? $post['catcity'] : '';
        $state = isset($post['state']) ? $post['state'] : '';
        $zip = isset($post['zip']) ? $post['zip'] : '';
        $email = isset($post['email']) ? $post['email'] : '';
        $connect = isset($post['connect']) ? $post['connect'] : 0;
        $model->setData('name',$name);
        $model->setData('street_address', $address);
        $model->setData('customer_type', $radio);
        $model->setData('city', $city);
        $model->setData('state', $state);
        $model->setData('zip', $zip);
        $model->setData('email', $email);
        $model->setData('stay_connected',$connect);
        //$model->save();
        $url = $this->_objectManager->get('Magento\Store\Model\StoreManagerInterface')
        ->getStore()
        ->getBaseUrl();
        $pdfUrl = $url.'var/uploadPdf/';
        $templateParams=array('customer' => 'test@gmail.com', 'store' => "1",'subject' =>"success message");
        $transport = $this->_transportBuilder
        ->setTemplateIdentifier('1')
        ->setTemplateOptions(array('area' => \Magento\Framework\App\Area::AREA_FRONTEND,'store' => 1))
        ->setTemplateVars($templateParams)
        ->setFrom(array('name' => 'test','email' => 'test.com'))
        ->addTo('test@gmail.com')
        ->getTransport();
        $transport->sendMessage();

        $this->_redirect('message');
        $this->messageManager->addSuccess(__('Thank you for contacting us. We will mail your catalog shortly.'));
    }
}


texts: Layered Navigation not working with multi-select attributes

texts:
I've set up two products with an attribute "ColorScheme". It's multiselect so that I can set one or several colors in the ColorScheme field.

Now, if I set one product to Red, Green and the other to Blue, in the front end Layered Navigation under ColorScheme I get, as expected, Red, Green and Blue, each showing (1) hit. (Two of these obviously select the same product.)

But if I set the two products to have overlapping lists, Nav seems to break.  If I set one product to Red, Green and the other Red, Blue, then in Layered Nav I get Green (1) and Blue (1), but not the Red (2) item I expected.

Is there a setting somewhere I have set wrong?

(I have flushed pages, and reindexed, and tried multiple different attributes and combinations, and this behavior is consistent.)


texts: Filter Product Collection by Child product attribute

texts:
I have situation like 2 attribute which is assign to child product

1) person_height_from and 2) person_height_to which has DropDown type attribute

which is only assign in child product but not assign in parent products,

I want to filter product collection in category page with this attribute

like length = 175

 $collection->addAttributeToFilter('person_height_from', array('lteq' => $length));

 $collection->addAttributeToFilter('person_height_to', array('gteq' => $length));

Is this possible to get only those parent product in category page which child product assign above value

your help will be appreciated


texts: How to show all swatches of out of product for a configurable products in magento 2

texts:
I want to show all swatches of product for out of stock products. Currently it is showing only in stock products.

how to show for out of stocks products.

How to display all swatches

Can someone help me to do this

Advanced thanks


texts: Disable customer password input field in Magento admin

texts:
In Magento Admin > Customers > Manage Customers > Select a customer > Account Information.

There is a password field the admin user can input a password for the customer. Due to security reasons, I would like to disable or remove this field and only have the "Send Auto-Generated Password" option available. Screenshot attached.


texts: Magento 1.9.4.2 known issues: compatibility with third-party checkout extensions

texts:
Did anyone encounter a problem with a third party checkout extension like Amasty OPC or IWD OPC? I haven't upgraded yet to Magento 1.9.4.2 because I read in the release notes that:

"Third-party checkout extensions and closed security cases will either not work securely or will not work at all."

https://devdocs.magento.com/guides/m1x/ce19-ee114/ce1.9_release-notes.html#ce19-1942


texts:
How i can set up cron time on config.xml on my module to magento??

Something like::

 <crontab>
        <jobs>
            <captcha_delete_old_attempts>
                <schedule>
                    <cron_expr><!--dynamic info here--></cron_expr>
                </schedule>
                <run>
                    <model>captcha/observer::deleteOldAttempts</model>
                </run>
            </captcha_delete_old_attempts>
            <captcha_delete_expired_images>
                <schedule>
                    <cron_expr><!--dynamic info here--></cron_expr>
                </schedule>
                <run>
                    <model>captcha/observer::deleteExpiredImages</model>
                </run>
            </captcha_delete_expired_images>

        </jobs>
    </crontab>


texts:
I wrote a custom script to force magmi to import data during a cron job, now I need to force reindexing. I tried using the magmi module but it didn't work so I'm running it manually.

passthru("php -f ".$config['shell']."/indexer.php -- --reindexall");

All passthru outputs is Content-type: text/html

This is driving me crazy, anyone have an idea about this? reindexer runs finevia command line, I have tried exec, there are no restricted functions.


texts: Magento2: Load Model Data By Another Field

texts:
I have below table named "messages".

id | posts_id  | message_description | created_at
-----------------------------------------------------------------------------
1      1           test1             2016-09-06 10:00:00
2      1           test2             2016-09-06 11:00:00
3      2           test1             2016-09-06 10:00:00
4      2           test2             2016-09-06 11:00:00

app\code\Custom\Module\Block\Edit.php

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$messages = $objectManager->create('Custom\Module\Model\Messages')->loadByPostsId($this->getRequest()->getParam('id'));
return $messages;

I would like to retrieve messages by posts_id. How can i get that?


texts: Set the price for gift option in magento1.9

texts: I want to set the price for particular gift option like the gift-card message on checkout page..how to do it please provide the proper way to set the price  for gift-message


texts:
I made the schema.grapqhs with this content:
type Query {
    quoteData (
        id: Int @doc(description: "Id of the Quote Data")
    ): QuoteData @resolver(class: "Vendor\\Module\\Model\\Resolver\\QuoteData") @doc(description: "The Quote Data Query Returns Data about a Quote Object")
}
type QuoteData @doc(description: "Quote information by quote id") {
    base_currency_code: String @doc(description: "Base Currency Code from Quote Object")
    grand_total: String @doc(description: "Grand Total of Specific Quote Object items")
    customer_name: String @doc(description: "Customer Name from Quote Object")
}

In my code, I am using curl to get the result of my query. This is the script:
        $endpoint = "http://magento.local/graphql";
        $query = '{
    quoteData(id: 1) {
        base_currency_code
        customer_name
        grand_total
    }
}';

        $headers = array();
        $headers[] = 'Content-Type: application/json';
        $headers[] = 'Authorization: Bearer '.$this->getBearerToken();

        $ch = curl_init();

        curl_setopt($ch, CURLOPT_URL, $endpoint);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 0);
        curl_setopt($ch, CURLOPT_POSTFIELDS, $query);
        curl_setopt($ch, CURLOPT_POST, 1);
        curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

        $result = curl_exec($ch);

        $info = curl_getinfo($ch);
        if ((int) $info['http_code'] !== 200) {
            var_dump($info['http_code']); exit();
        }
        $header_size = curl_getinfo($ch, CURLINFO_HEADER_SIZE);
        $body = substr($response, $header_size);
        var_dump($body); exit();

The result of my var_dump is:
{"errors":[{"debugMessage":"Unable to unserialize value. Error: Syntax error","message":"Internal server error","extensions":{"category":"internal"},"trace":[{"file":"\/vendor\/magento\/module-graph-ql\/Controller\/GraphQl.php","line":184,"call":"Magento\\Framework\\Serialize\\Serializer\\Json::unserialize('{\n    quoteData(id: 1) {\n        base_currency_code\n        customer_name\n        grand_total\n    }\n}')"},  ......

Any idea what am I doing wrong here ? Thank you


texts: Is there a way to stop an installation in progress?

texts:
I'm trying to set up a new Magento 2.3 instance and I got stuck at 93%. I found through  here that my max_execution_time was set to low. So I fixed that, but now I want stop the installation. I can't restart the server because there are other sites on the server. What else could I do? I'm using plesk lightsail which is Ubuntu and php 7.2.

EDIT: Just as a side note one of the reasons this kept hanging up was I trying to use the sample data, which was just not working.


texts: ssl configuration in checkout process of magento

texts:
i want to configure https in checkout process instead of whole site i perform the configuration like this

if i put the https in Unsecure  it is applying on whole site which i dont want i just want to enable https on checkout and login part of frontend and rest of site being with http i also try this module also but did not work

kindly help me in this prob thanx


texts: Magento 2.3.5-P2 : Method 'getExtensionAttributes' must be overridden in the interfaces

texts:
Recently we upgraded magento version from 2.3.2 to 2.3.5-p2. We are getting error while placing an order after update. In 2.3.2 version there is no issue.
Error :
report.CRITICAL: Method 'getExtensionAttributes' must be overridden in the interfaces which extend 'Magento\Framework\Api\ExtensibleDataInterface'. Concrete return type must be specified. Please fix :\Namespace\Modulename\Api\Data\PaymentInterface {"exception":"[object] (LogicException(code: 0): Method 'getExtensionAttributes' must be overridden in the interfaces which extend 'Magento\\Framework\\Api\\ExtensibleDataInterface'. Concrete return type must be specified.

 Please fix :\\Namespace\\Modulename\\Api\\Data\\PaymentInterface at C:\\xampp\\htdocs\\Magento235\\vendor\\magento\\framework\\Api\\ExtensionAttributesFactory.php:68)"} []

Thanks in advance..!


texts: Add products with selections directly from category view in Magento 2

texts:
Products without options can be added to cart directly from category view in the default theme.

I would like to be able to add all products directly from category view. Even if they have options for color and size.

Is there such a function in Magento 2?

Preferable I would like to have a select for color and size and also have a input for quantity.


texts: Magento 2.4 with ElasticSearch - include category name in index?

texts:
Is there a way to get Magento 2.4 with ElasticSearch to also index the category name alongside the product? For example, I would like someone searching for "wine" to find not only products with wine in the product name, but also products that are in the "Wine" category.
Is it possible to add additional data into the search index to achieve this?


texts:
I try to override Magento_Cms::browser/content/files.phtml but when i test , the block is dont display , and i dont know why

i have the next extructure

<Vendor>_<Module>
├── <Stuff>/
│   ├── etc/
│   │   ├── module.xml
│   ├── view/
│   │   ├── adminhtml/
│   │   │   ├── layout
│   │   │   │   ├── cms_wysiwyg_images_contents.xml
│   │   │   ├── templates
│   │   │   │   ├── browser
│   │   │   │   │   ├── content
│   │   │   │   │   │   ├── files.phtml
│   │   │   ├── web
│   │   │   │   ├── images
│   │   │   │   │   ├── icon
│   │   │   │   │   │   ├── pdf.png
│   ├── registration.php/

cms_wysiwyg_images_content.xml

<?xml version="1.0"?>

<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd">
    <container name="root">
        <referenceBlock name="wysiwyg_images.files">
            <arguments>
                <argument name="template" xsi:type="string">Vendor_Stuff::browser/content/files.phtml</argument>
            </arguments>
        </referenceBlock>
    </container>
</layout>

files.phtml

<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

// @codingStandardsIgnoreFile

 /** @var $block \Magento\Cms\Block\Adminhtml\Wysiwyg\Images\Content\Files */

$_width  = $block->getImagesWidth();
$_height = $block->getImagesHeight();

?>
<?php if ($block->getFilesCount() > 0): ?>
    <?php foreach ($block->getFiles() as $file): ?>
    <div data-row="file" class="filecnt" id="<?= $block->escapeHtmlAttr($block->getFileId($file)) ?>">
        <p class="nm" style="height:<?= $block->escapeHtmlAttr($_height) ?>px;width:<?= $block->escapeHtmlAttr($_width) ?>px;">
        <?php if ($block->getFileThumbUrl($file)):?>
            <img src="<?= $block->escapeHtmlAttr($block->getFileThumbUrl($file)) ?>" alt="<?= $block->escapeHtmlAttr($block->getFileName($file)) ?>"/>
        <?php endif; ?>

        <?php if ($block->getFileWidth($file)): ?>
            <?= $block->escapeHtml($block->getFileWidth($file)) ?>x<?= $block->escapeHtml($block->getFileHeight($file)) ?> <?= $block->escapeHtml(__('px.')) ?>

        <?php endif; ?>
        <?= $block->escapeHtml($block->getFileShortName($file)) ?>

    <?php endforeach; ?>
<?php else: ?>

<?= $block->escapeHtml(__('No files found')) ?>

<?php endif; ?>

i use "magento/product-community-edition": "2.2.6"

any suggestion ?


texts: I want to add new dropdown after status tex box where can i do


texts: Use custom attribute or emailid to sign in magento2

texts: I created a custom attribute "Mobile Number" for Customer. I want to make users sign in using this attribute (or the default emailid) and password , how can I accomplish that in magento2


texts: I want to create a shop with affiliate products, i need to import them from csv feed

texts:
I want to import products from csv file. But how to get product images from an url?
The csv file contain the image url and affiliate link too. I need to import this two fileds in specific places.


texts: magento 1.7.x remove Sales Rules & Coupons for using database

texts:
I have direct database of magento 1.7.x and I have to remove all Sales Rules & Coupons using mysql Query.

I don't want to use any magento code even PHP code.

I have just need database query to remove all my Coupons form database.


texts: magento2 addtocart not working in chrome and extremely slow

texts: I have magento2 installed on local machine the addto cart works in mozilla on product page how ever its extremely slow and on chrome it shows adding after addto cart but it does not add at all, there is no error in console but it does not add to cart.


texts: Add to cart creating new product programatically

texts:
We have 2 buttons in product view page

1)Create - create product programtically

2)Add to cart - Add product to cart &  creating product programatically.

  Issue is we dont need to create product once click on "Add to cart"

  create button code

<button id="submit-editorApply-{{rand}}"  onclick="return setproductlogin(\'<?php echo Mage::registry("current_product")->getId()?>\', event);setrequestlogin();"  >
    create
    </button>

  Add to cart

<button onclick="productAddToCartForm.submit(this)" id="submit-editorApply-add-to-cart">
    Add to cart>
    </button>

  related code

initObservers: function()
      {
        if (this.config.editorEnabled) {
           $('submit-editorApply-' + this.config.rand).observe('click', this.saveDesignBut.bindAsEventListener(this));
           $('submit-editorApply-add-to-cart').observe('click', this.submitApply.bindAsEventListener(this));
         }
       },

submitApply: function(event)
        {
         Event.stop(event);
         this.option.apply();
         if(window.productAddToCartForm == 'undefined') {
         var productAddToCartForm = new VarienForm('product_addtocart_form');
         } else {
          var productAddToCartForm = window.productAddToCartForm;
         }
         productAddToCartForm.submit();

         },

  Update

once i remove function : submitApply: function(event) [see full function above ] , than Add to cart button will not create any product. but after that, we need to click on create button to click on Add to cart, otherwise Add to cart will not work....

  update 2

when i hide this code : $('submit-editorApply-add-to-cart').observe('click', this.submitApply.bindAsEventListener(this)); & removed aitcg-required , than both features will work, but one more issue will create that once we click directly on add to cart [ without click on create] button, than in cart page, we dont see custom image :


texts:
When I try to ship an order that has the word "leash" in the SKU, this error message appears.

Source item not found by source code: default and sku:

All I can do is offline credit memo the order to change it from "Processing".

My store was migrated from a 1.9.0.1 installation. But it appears to only be SKUs with the word "leash" in them... all other SKUs seem to be working fine.


texts:
I have a custom attribute for customers but when I try to set any value to this attribute it does not save.

I have this code:

public function getAllow(){
  $customer = Mage::getSingleton('customer/session')->getCustomer();
  $customer->setAllowboms("0");
  $customer->save();
  return $customer->getAllowboms();
}

When I call the function getAllow() return the value 0 but if I comment $customer->setAllowBoms('0'); and $customer->save(); don't return any value.


texts: How to use \Magento\Framework\Controller\Result\JsonFactory for Magento 2.3?

texts:
This post is related to this Magento2 - How to get JSON response from Controller

What I am trying to do is to format the json response of my custom web API, but it seems \Magento\Framework\Controller\Result\JsonFactory doesn't seem to work in Magento 2.3

Here's my implementation:

/** @var \Magento\Framework\Controller\Result\JsonFactory  */
protected $resultJsonFactory;

public function __construct(
    ...
    \Magento\Framework\Controller\Result\JsonFactory $resultJsonFactory
    ...
) {
    ...
    $this->resultJsonFactory = $resultJsonFactory;
    ...
}

And implemented it like this:

$result = $this->resultJsonFactory->create();
$result->setData(['message' => 'test']);
return $result;

And the result (Just a blank bracket):

[]

Additional solution made:
Tried to implement \Zend_Json::encode() and json_encode but getting this result:

"{\"message\":\"test\"}"

Instead of (expected result/prettified json response):

{
    "message": "test"
}


texts: What Is The Default Magento Weight Unit And How Can Change It

texts:
I use Amasty Table Rate extension. I need to know in which weight measurement Magento is converting data.

Ans also from where I can change its default measurement unit.
I used gram, but I want to use KG - Kilo Gram for shipping.

So I need to change Magento weight measurement unit.
How can I do that, any setting is available in Magento Backend?


texts:
I want to add a new page like the success or failure pages.
In /app/design/frontend/default/[theme]/layout/checkout.xml I saw this:

<checkout_onepage_failure translate="label">
        One Page Checkout Failure
        <reference name="root">
            <action method="setTemplate"><template>page/2columns-right.phtml</template></action>
        </reference>
        <reference name="content">
            <block type="checkout/onepage_failure" name="checkout.failure" template="checkout/onepage/failure.phtml"/>
        </reference>
    </checkout_onepage_failure>

So I added this:

<checkout_onepage_pay translate="label">
        One Page Checkout Payment
        <reference name="root">
            <action method="setTemplate"><template>page/2columns-right.phtml</template></action>
        </reference>
        <reference name="content">
            <block type="checkout/onepage_pay" name="checkout.pay" template="checkout/onepage/pay.phtml"/>
        </reference>
    </checkout_onepage_pay>

And did the same in /app/design/frontend/base/default/layout/checkout.xml

And added my page to /app/design/frontend/base/default/template/checkout/onepage/
But I'm getting an 404 error, and dunno where else have to make reference to my page.

Thank you.

Edit: don't know if is important but this page it will show after the "Place Order" button is clicked.

Keep looking and I found this in Checkout/controllers/OnepageController.php

public function failureAction()
    {
        $lastQuoteId = $this->getOnepage()->getCheckout()->getLastQuoteId();
        $lastOrderId = $this->getOnepage()->getCheckout()->getLastOrderId();

        if (!$lastQuoteId || !$lastOrderId) {
            $this->_redirect('checkout/cart');
            return;
        }

        **$this->loadLayout();
        $this->renderLayout();**
    }

So here is where load and render the failure template, right? Where is called this method? D:


texts:
I installed varnish, I'm 100% sure varnish works on the frontend. I see the below info in response header in chrome console.

  X-Magento-Cache-Debug:HIT

I don't see the above info in admin side URL, I don't feel the speed improvement also.

I'm not seeing any confirmation about this so I'm just looking confirmation.


texts: How do I enable https for my site in Magento 1.9.3.7?

texts:
Where would I go in the Admin Panel of Magento 1.9.3.7 to change my site to be https and secure?

Thank you.


texts: Why does the Database Repair Tool require a fresh installation?

texts:
I've used the Magento Database Repair Tool a couple of times and I'm always puzzled at why it needs a fresh database installation.

Would it not be more efficient to have a database tool per Magento Version?

Could someone explain why this is necessary if Magento is standard (no other distros), wouldn't all the tables ect be the same from one installation to another?


texts:
I am unable to change Locale options in Stores >> Configuration >> General tab Configurations. After saving the configurations it shows 'You saved the configuration.' but there is no change.

Flushed the cache, reindexed but still no change.
Checked console but no error in console.

  update 1
  Disabled all third party extensions but it still didn't worked.

update 2
Can't save any general configuration in Default Config store view.


texts: How to display subcategories on same height as parent-category in Magento 2 -menu

texts:
So I have multiple categories which have their subcategories and which have their subcategories etc etc.. So right now, when I'm navigating through vertical-menu, and hover over a category, the subcategories always display AT THE TOP of the menu. Even if the parent category was way down on the menu. I want subcategories to open on the same height as the parent category. I added both text and picture to demonsrate the problem.

Here's how the menu works at the moment:

 - menu________subcategory
 - menu________subcategory2
 - menu
 - menu
 - opened menu

And here's how I want it to work:

 - menu
 - menu
 - menu
 - menu
 - opened menu|subcategory
 - ____________subcategory2

What do I have to do?


texts: Magento 2 set default language to spanish

texts: I am using Magento 2.2.5. I need to set the Default language as Spanish instead English in the Luma theme. How to set this.


texts:
For some reason, my onChange event on my select input fires when the page load.

What I'm trying to do is have an onChange event occur when the user selects the first option of a select dropdown.  But since the first option is default, it is firing automatically.  I can't change the default as that is against what the client wants.  Is there a way to disable this? I'm not too familiar with how magento fires off javascript on page loads, since I think that's what the problem is.

This is mostly for my catalog/product/view/type/options/configurable.phtml page where I want something to happen (like an alert) when user clicks on the first option of the configurable product.

<?php
$_product    = $this->getProduct();
$_attributes = Mage::helper('core')->decorateArray($this->getAllowAttributes());$_jsonConfig = $this->getJsonConfig();$_renderers = $this->getChild('attr_renderers')->getSortedChildren();?><?php if ($_product->isSaleable() && count($_attributes)):?>

<?php foreach($_attributes as $_attribute): ?>
    <?php
    $_rendered = false;
    foreach ($_renderers as $_rendererName):
        $_renderer =       $this->getChild('attr_renderers')->getChild($_rendererName);
        if (method_exists($_renderer, 'shouldRender') &&     $_renderer->shouldRender($_attribute, $_jsonConfig)):
            $_renderer->setProduct($_product);
            $_renderer->setAttributeObj($_attribute);
            echo $_renderer->toHtml();
            $_rendered = true;
            break;
        endif;
    endforeach;

    if (!$_rendered):
    ?>

*<?php echo $_attribute->getLabel() ?>

    <dd<?php if ($_attribute->decoratedIsLast){?> class="last"<?php }?>>

            <select name="super_attribute[<?php echo $_attribute->getAttributeId() ?>]" id="attribute<?php echo $_attribute->getAttributeId() ?>" class="required-entry super-attribute-select" onChange="spConfig.getSelectedIndex()">
                <option><?php echo $this->__('Choose an Option...') ?></option>
              </select>

    <?php endif; ?>
<?php endforeach; ?>

<?php if ($this->getLayout()->getBlock('size_chart')->getSizeChartVersion() > 0): ?>
    Size Chart
<?php endif; ?>

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


texts: How to add Widget layout updates field in my custom module admin form Magento 2

texts:
I am working on a custom module where I want to add the following field in my admin form

in have my admin form developed in using ui_component I want to add this field (in this picture) after a field

<field name="slider_type">
            <argument name="data" xsi:type="array">
                <item name="options" xsi:type="object">vendor\modulename\Model\Config\Source\ProductType</item>
                <item name="config" xsi:type="array">
                    <item name="component" xsi:type="string">vendor_modulename/js/form/element/options</item>
                    <item name="dataType" xsi:type="string">text</item>
                    <item name="label" xsi:type="string" translate="true">Type</item>
                    <item name="formElement" xsi:type="string">select</item>
                    <item name="source" xsi:type="string">modulename</item>
                    <item name="dataScope" xsi:type="string">slider_type</item>
                    <item name="validation" xsi:type="array">
                        <item name="required-entry" xsi:type="boolean">true</item>
                    </item>
                </item>
            </argument>
        </field>

how can I add this in my admin form please help


texts: mydomain.com is listed in DBL. What is alternative to send email from Magento Store

texts:
Don't know why but My Magento store Domain is listed in DBL. and my customers are unable to receive email.

But i am in search of any good tool/extension which i can use to send Order Emails. I have used the SMTP pro but it receive email inside Dashboard only .


texts: How to allow special characters like '," in catalog search?

texts: How to allow special characters like '," in catalog search ? If I search with abc'th it results all products.


texts:
How to create categories and sub categories programmatically in magento2?

Please anyone knows then explain me.


texts: How to add category Path when creating product progrmatically in magento 2

texts:
I want to create products programatically by reading an xml file.
Reading from xml, and creating product part is completed.
I have no idea how to assign the products to category.
This is my xml node for the categories.

<categories>Default Category/Wine,Default Category/Collections,Default Category/Spirits,Default Category/Spirits/VODKA/Plain,Default Category for Store 2/Collections,Default Category for Store 2/Wine,Default Category for Store 2/Spirits,Default Category for Store 2/Spirits/VODKA/Plain
    </categories>

Extracted categories from the categories xml node below

  Default Category/Wine

  Default Category/Collections

  Default Category/Spirits,

  Default Category/Spirits/VODKA/Plain

  Default Category for Store 2/Collections

  Default Category for Store 2/Wine

  Default Category for Store 2/Spirits

  Default Category for Store 2/Spirits/VODKA/Plain

To set the categories i want to use below code set

$category_id= array(4,5);
// add your catagory id
$set_product->setCategoryIds($category_id);

How can i get the category ids from the xml node <categories>...</categories>.

I can get the category id of a last word of category by using below code.

$categoryTitle = 'Wine';
$collection = $this->_categoryFactory->create()->getCollection()
          ->addAttributeToFilter('name',$categoryTitle)->setPageSize(1);
if ($collection->getSize()) {
   $categoryId = $collection->getFirstItem()->getId();
}

But i cannot use above code , because i have 2 stores and categories belongs to two stores.Please help me to complete this task.


texts: Magento 2 Global Search not working for products

texts:
I am using magento2ee 2.1.4. I just realized that global search for the products is not working. Here is the screen shot .

while I am clicking on first search result i.e. bag in products, it is not returning right results.

So, to check this i have tried magento2ce 2.1.8 and checked the case and the same issue is found in CE also. Global search for the products is not working in any of the versions. Any idea why global search is not working in magento2 and how to fix this???


texts: "Delete operation is forbidden for current area" error while create customer in Magento 2

texts:
I modified register page and added address fields. So, when user register address will be save.

But having this error when try to save customer.

Delete operation is forbidden for current area

When i removed this code - <input name="create_address" value="1" type="hidden">

then customer save but address not save.

But if added this code then above error is showing and redirect to register page.

Any idea guys?

Thanks in advance!


texts:
I'm trying to modify URL-Category Rules, from Category Hierarchy-Oriented rules to Seo-Oriented rules.

So i need to change URLs in this way.

From:

- Root-Category (URL: /rootcategory.html )

-- Sublevel category --> /rootcateogory/sublevelcategory.html

--- 3rd level Category --> /rootcategory/sublevelcategory/3rdlevelcategory.html

To:

- Root-Category (URL: /rootcategory.html )

-- Sublevel category --> /sublevelcategory.html

( without First level cateogory url key )

--- 3rd level Category --> /sublevelcategory/3rdlevelcategory.html

( without First level cateogory url key )

I'm in trouble whit Magento Admin configurations but it seems there is no way to do this.

Do i have to build a Magento Plugin ?

Any suggestions ?

EDIT

I'm running Magento EE ver. 1.13.1.0


texts:
I'm looking for a way to be able to add a Dropdown (select) to the Contact Page and use it as a Subject later on in the email.

I've tried simply adding a dropdown but it doesn't seem to be working:

this is what I've tried in form.phtml

        <select id="subject" data-validate="{required:true}"/>
            <option value="Subject" disabled>Subject</option>
            <option value="volvo">Volvo</option>
            <option value="volvo">Volvo</option>
            <option value="saab">Saab</option>
            <option value="mercedes">Mercedes</option>
            <option value="audi">Audi</option>
        </select>

and this is the Email Templates

{{trans "Subject: %subject" subject=$data.subject}}


texts: How to get all orders id for curent customer?

texts:
I need to get all orders id for current customer in my custom customer tab!

I'm using: $orders = Mage::getModel('sales/order')->getCollection();

This is my Tab where I want to add Order No and Sum:


texts: How to fetch eligible Payment and Shipping method in REST API magento 2?

texts:
Fetch eligible shipping methods and Payment methods in Magento 2 Rest API.

In case of if i have a customer id.
In case of if it is a guest user.


texts: First product save doesn't take during new admin session

texts:
For a new admin session, the first time I save a product, magento is very slow to save (30 seconds or longer) and goes back to products admin with no save to the product. After the first time attempting to save a product, other product saves happen quickly (1 second or so).

This only happens the first time during an admin session.

Magento 1.9.2 Lesti fpc m2e pro

Plenty of resources available for the php and mysql environment.


texts: Magento : Product URL with last subcategory

texts:
I am exporting products from Wordpress to Magento. In Wordpress url structure is like this:

www.mysite.com/sub-category/product/

but when I am opening this in Magento product url is like this:

www.mysite.com/category/sub-category/product/

Its also opening if I remove category from url:

www.mysite.com/product/

But I want subcategory in url like in Wordpress (www.mysite.com/sub-category/product/)

Any ideas?


texts: Pointers to write unit test cases using EcomDev_PHPUnit

texts:
I am trying to implement a web service client for one of my module and I would like to test it using EcomDev_PHPUnit. So, I have a "Test" folder inside my module with following structure...

- Webservice
-- Clientservice
---Model
----Callservice.php
--- Test
----Model
-----Callservice.php

My "Callservice.php" has a "httpRequest()" function that does Mage::log("Hello world!");
And as I am testing a service, I don't need any fixtures as of now...

But when I try to run "phpunit UnitTests.php"...I see a series of errors.The first few lines are about EcomDev_PHPUnitTest module I think we can ignore it safely. The other errors says that

Warning
There is no module with name: webservice_clientservice

My config.xml top most few lines are as follows,

<?xml version="1.0" encoding="UTF-8"?>
 <config>
    <modules>
        <Webservice_Clientservice>
            <version>0.1.0</version>
        </Webservice_Clientservice>
    </modules>
  ...
  ...
 <phpunit>
    <suite>
        <modules>
             <Webservice_Clientservice />
        </modules>
        <groups>
            <model>Model</model>
        </groups>
    </suite>
 </phpunit>
 </config>

My module xml file is Webservice_Clientservice.xml as follows,

<?xml version="1.0" encoding="UTF-8"?>
 <config>
    <modules>
        <Webservice_Clientservice>
            <active>true</active>
            <codePool>community</codePool>
            <depends>

            </depends>
        </Webservice_Clientservice>
    </modules>
 </config>

And when I use phpunit --filter <> UnitTests.php, I see the below -

PHPUnit 3.7.22 by Sebastian Bergmann.

Time: 1 second, Memory: 14.75Mb

No tests executed!

That leaves me perfectly confused. How do I write test cases(without test suites and later with test suites) in EcomDev_PHPUnit? Any pointers or same modules would be really great. Thanks!

Well it worked with the following:

I had missed a file "phpunit.xml.dist" in the magento root directory, not just that. I had to comment out a few lines in UnitTests.php in the magento root directory too - after which it looks as below -

<?php

//bootstrap.php already does this, not sure why we would need it here again
/*require 'app/Mage.php';

if (version_compare(PHP_VERSION, '5.3', '<')) {
    exit('Magento Unit Tests can be runned only on PHP version over 5.3');
}

if (!Mage::isInstalled()) {
    exit('Magento Unit Tests can be runned only on installed version');
}

$_SERVER['SCRIPT_NAME'] = dirname(__FILE__) . DS . 'index.php';
$_SERVER['SCRIPT_FILENAME'] = dirname(__FILE__) . DS . 'index.php';

Mage::app('admin');
Mage::getConfig()->init();*/

class UnitTests extends EcomDev_PHPUnit_Test_Suite
{

}

so now I see the log entry in mage system.log :)

Well, I am not yet sure if this is the right way...comments welcome


texts: Call custom attribute of child within configurable product

texts:
Magento 1.9.2.2

Hi all

I've got a puzzle I'm stuck on and I know it must be fairly straight forward but it is driving me mad. I'm trying to load the value of a custom attribute (in this case a hex color assigned to the simple product that will be used to change the color of text within a div area) within a configurable product, so when the child is selected, the attribute is used.

You can see an example here: http://www.store2.welcometotheweb.co.uk/index.php/canvas

So when you select the "Purple", it will load the attribute for that product ColorCode which can then be used for the text color of the other input fields. I've been able to use a snippet which will echo a list of the associated attributes associated to the configurable product itself, but obviously not what I want.

Any direction would be greatly appreciated.

UPDATE

I've been able to call in a list of the attributes from the child using the code below, so I know there is no issue with actually accessing the data from the products, but with a limited knowledge of php, am not sure of the correct method to adapt this to be able to call only the current child product data.

<?php
$conf = Mage::getModel('catalog/product_type_configurable')->setProduct($_product);
$col = $conf->getUsedProductCollection()->addAttributeToSelect('*')->addFilterByRequiredOptions();
foreach($col as $simple_product){
     var_dump($simple_product->getData('color_code'));
 } ?>


texts: Magento API url dispatch via custom admin url

texts: Can my store resolves API request using custom admin url? Eg: https://admin.magento.lc/api/v2_soap?wsdl=1? Here problem is if I use api url via custom admin url it redirects to frontend.


texts: Transactional Emails w/o Text Formatting?

texts:
I wanted to know if it is possible to convert all the sending transactional mails into the text format like Amazon/StickerMule does? Basically something without text formatting and just plain text so as to improve the sending time and decrease the size of the email. It gives all the information that is required and also is easily downloadable without eating up any data.

I was assuming this is a good option, isn't it?

Some examples:

I would be really glad if someone could assist me with that.


texts: catalogsearch_fulltext count after finished reindexing

texts:
I know I can watch the progress of the indexer if I look at the database table catalogsearch_fulltext.

What will be the count of rows after the reindexing is finished?

I guess it is related to product count, searchable attributes and store view? I have 76051 products, 16 searchable attributes, 2 stores.


texts:
I recently reindex all my magento e-commerce site. After when i try to save an invoice it gave me " Unable to save the invoice"

When i looked at the log file, i see this error :

1452 Cannot add or update a child row: a foreign key constraint fails (website_database/eav_attribute, CONSTRAINT FK_EAV_ATTRIBUTE_ENTITY_TYPE_ID_EAV_ENTITY_TYPE_ENTITY_TYPE_ID FOREIGN KEY (entity_type_id) REFERENCES eav_entity_type (entity_type_id) ON DEL)

Do you have any idea how can i fix this ?


texts: How to hide proceed to checkout button in mini-cart in magento 2

texts:
I managed to hide the chekout button using a custom module. I followed this threads
to achieve this. I can hide the checkout button in mini cart now.But i want to add some condition to show the Proceed to Checkout button. Where i want to pass the cart total value to minicart.js file in my custom module.

Below are the steps i tried

(app/code/Ayakil/app/code/Vendor/Module/etc/di.xml/etc/di.xml).

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

My DefaultConfigProvider.php ( app/code/Ayakil/MinicartCustomization/Model/DefaultConfigProvider.php )

<?php
namespace Ayakil\MinicartCustomization\Model;

use Magento\Store\Model\ScopeInterface;
use Magento\Framework\Session\SessionManager;

class DefaultConfigProvider extends \Magento\Checkout\Model\DefaultConfigProvider
{
private $coreSession;
public function __construct(
    SessionManager $sessionManager
) {
    $this->coreSession = $sessionManager;
}

public function getConfig()
{
    $output = parent::getConfig();
    if($this->coreSession->getVIErequestData()){
        $output['session_VIEUserData'] = true;
    }else{
        $output['session_VIEUserData'] = false;
    }

    return $output;
}
}

my minicart-mixin.js file like below.

define([
'uiComponent',
'Magento_Customer/js/customer-data',
'jquery',
'ko',
'underscore',
'sidebar',
'mage/translate',
'mage/dropdown'
], function (Component, customerData, $, ko, _) {
'use strict';

var mixin = {
    isButtonEnable: function () {
        /*You can add your condition here based on your requirements.*/
        console.log(window.checkoutConfig.session_VIEUserData);

        return false;
    }
};

return function (target) {
    return target.extend(mixin);
};
});

In my minicart-mixin.js file if i try to access like console.log(window.checkoutConfig.session_VIEUserData); i am getting an error.

  TypeError: window.CheckoutConfig is undefined

My question is how can i pass a variable to minicart-mixin.js and access the data?


texts: Related Product Rules not showing up in magento2?

texts:
I am trying to create Related product rules by following below link.

https://www.bluefishgroup.com/insights/ecommerce/related-products-rules-in-magento-2/

When i navigate into Marketing i can see only Catalog price rules and cart price rules under Promotion. Why Related product price rule not showing up?

My magento version is 2.2.4.

Please anyone advise on this. Any other settings are required to be done?


texts: Magento2: Errors installing Sample Data: Class "\Magento\SampleData\Model" not found / no commands defined in "sampledata" namespace

texts:
I am trying to install Magento2 version 1.0.0-beta.

I followed instructions about installing sample data from: http://devdocs.magento.com/guides/v2.0/install-gde/install/sample-data.html

I enabled sample data before installing Magento and at the end of installation, I got the following error:

  Error during sample data installation:
  Source class "\Magento\SampleData\Model" for "Magento\SampleData\Model\Logger" generation does not exist

I then tried installing sample data after installing Magento.
I am getting the following error while installing sample data after installing Magento:

  [InvalidArgumentException]
  There are no commands defined in the "sampledata" namespace.


texts: how to show discount amount excluding tax in create invoice

texts:
I have used "Magento ver. 1.9.2.1", I have added fixed discount to order items.

Using discount Order placed successfully and sales -> order shows correct order total but when create invoice then invoice total shows discount amount with tax.But I want to shows discount amount without tax.

For example order total with discount Rs 10 shown in figure:

And when I create invoice for this order then discount amount(Rs 10) shows after adding tax 11.45 ( where tax 14.5% ) as shown in figure :

How to shows discount amount in create invoice template without adding tax?


texts: Why the checkout spinner keeps spinning in Magento 2?

texts:
It has always worked and now suddenly the spinner in the checkout keeps spinning and doesn't stop loading... I flushed cache again but the problem persists.

Any ideas?


texts:
When we try to insert the image in cms page or cms block the popup not showing any images which we have uploaded as well as no button for upload image.
Please check below image:


texts: Can't PUT customer in Rest Api Magento2 - fails to complete

texts:
How do you PUT (update) a customer using the rest api?

I have a ticket open on github, but I was wondering if I'm just doing this wrong..

https://github.com/magento/magento2/issues/5115

I've created a customer in admin.  I've noted the entity id. It is 22.

I'm attempting to PUT using the rest api to myhost.com/rest/V1/customers/{{myEntityId}}

The actual URL is http://192.168.5.65/rest/V1/customers/22 just to avoid confusion.

I'm sending the following json:

{
    "customer": {
        "firstname": "NewMitchell",
        "lastname": "NewThompson"
    }
}

Magento documentation states you only need to send the properties you want to update.

I'm expecting the customer object to be updated, but its actually trying to create a new customer.  I'm seeing this message come back:

{
  "message": "Please enter a customer email.",
  "trace": "#0 /var/www/vendor/magento/module-eav/Model/Entity/VersionControl/AbstractEntity.php(90): Magento\\Customer\\Model\\ResourceModel\\Customer->_beforeSave(Object(Magento\\Customer\\Model\\Customer))\n#1 /var/www/vendor/magento/framework/Interception/Interceptor.php(74): Magento\\Eav\\Model\\Entity\\VersionControl\\AbstractEntity->save(Object(Magento\\Customer\\Model\\Customer))...blahblahblah

I'm afraid I may be doing it wrong, but at the same time, I think I may have identified a bug.

Can anyone test this and see if it works or not?  I'm using Magento CE RC3, but i've tested it on Magento CE 2.0.6 and it doesn't work there either.


texts:
I am Patrick and a super beginner. my Magento2 admin page shows a 404 error(whoops, our bad...).
windows 10, xampp 3.2.4, php 7.3.27, magento 2.4.2., phpmyadmin.
and I changed apache port 80 to 8888, 443 to 8889. I put localhost:8888 of course.
I installed it with the sample successfully.
and I put '/pub/' in my domain using my DB table core_config_data(web/unsecure/base_url). Before I did
it, every page was a 404 error. Thanks to '/pub/', I could have saved a first sample page. Only the first page.(localhost:8888/mymagentoname/pub/ - It shows the first page well.)
But when I try to enter the admin page or others (ex. gear - bag) show me a 404 error.
domain/Index.php also makes a 404 error.
that lists are what I've done to resolve the 404 error,

Cache clean and flush(cmd)
Reindex(cmd)
deploy -f(cmd)
Check admin URL again(env.php)
AllowOverride All(httpd.conf)

Whatever you comment, it would be helping me.
Thank you.


texts: I am getting incorrect count of products for layered navigation in magento 2.3

texts:
In layered navigation filter i am getting incorrect product count, i can't get the solution for this problem.

Example :

The products under Shorts category in 49 but in the filter for me showing as 12.

Thanks in advance :)


texts:
I'm customizing the customer_account section of my store and would like to two different layouts for the pages in this section.

I was able to customize the whole customer_account section to use the customer-account.phtml like this (in THEME_NAME/default/layout/customer.xml):

<customer_account translate="label">
    <label>Customer My Account (All Pages)</label>
    <!-- Mage_Customer -->
    <reference name="root">
        <action method="setTemplate"><template>page/customer-account.phtml</template></action>
        <action method="addBodyClass"><class>customer-account</class></action>
    </reference>
    ...
</customer_account>

I've tried adding the following to the customer_account but it's not working:

    <reference name="orders">
        <action method="setTemplate"><template>page/2columns-right.phtml</template></action>
    </reference>

How can I use a different layout for the "My Orders" section?


texts:
I got a project where a client who is running a relatively big e-commerce is planing to switch from Joomla's VirtueMart 1.1 to Magento 2.0.

What is the best way to export products/customers/discounts/reviews to Magento 2.0?
Are there any tools that work available or should I start writing PHP script which would map everything in CSV ?

Thank you for any info regarding this issue.


texts: Magento 1.9 redirect catalog/product/view/id/123 URL to product-url Key

texts:
In Magento 1.9 I was facing this issue on all the product listing pages as the links generated were like (catalog/product/view/id/123), which I have managed to change to product url by setting "Use Web Server Rewrites" to yes.

But now I need if someone enters the url (catalog/product/view/id/123) then it should also be redirected to (product-name.html)


texts:
Any time I run bin/magento setup:upgrade I get Incorrect theme identification key

I understand the source is vendor/magento/framework/View/Design/Theme/FlyweightFactory.php
so I had added echos to try and figure something out

I get

First pass 1, second pass NULL

Now, would be nice to understand where 1 and NULL come from

mysql> select theme_id, theme_path, area from theme;
+----------+-----------------+-----------+
| theme_id | theme_path      | area      |
+----------+-----------------+-----------+
|        1 | Magento/blank   | frontend  |
|        2 | Magento/backend | adminhtml |
|        3 | Magento/luma    | frontend  |
+----------+-----------------+-----------+

mysql> select * from core_config_data where path like '%theme%';
+-----------+----------+----------+-----------------------+-------+
| config_id | scope    | scope_id | path                  | value |
+-----------+----------+----------+-----------------------+-------+
|        34 | stores   |        1 | design/theme/theme_id | 3     |
|        58 | websites |        1 | design/theme/theme_id | 3     |
|        82 | default  |        0 | design/theme/theme_id | 3     |
+-----------+----------+----------+-----------------------+-------+

Only theme set is 3 (Luma), so I don't get how 1 gets passed.
I don't know where the "crontab" area theme is set. Is there anywhere I can set that value so I won't get the error?

Any help is appreciated, happy to provide more info.


texts: How can I send a customer an email with a link to the payment gateways?

texts:
We need to allow our customers to place a (pre)order, filling all the data at checkout

  (product type and quantity, name, email, shipping/billing address,
  shipping method calculated)

except their payment information. We think in creating a new payment option labeled "reservation" or "pay on delivery" for that and limit the checkout only to this method (order/payment status will be placed "on hold", or "pending").

Once placed the order, it will take about 4-6 weeks for us to have the product ready for shipping.

(We don't need to charge our customers any down-payment). When it is ready, we'll enter Magento to un-hold the order and send an email to our customer, with a link to the payment page of our store, where he/she can find all other available payment options (PayPal, credit card, or check).

Is that possible with Magento? How can we do it, please?

Thank you in advance!


texts:
I'm not sure if I've used the correct terminology but this is what I want to achieve.

I want to combine two php "commands" to output the title tag as follows:

So the title shows "Shoes by Nike"

The code I'm using is

title="<?php echo $this->htmlEscape($_product->getName()) ?> by <?php echo $_product->getAttributeText('company'); ?>"

Where <?php echo $this->htmlEscape($_product->getName()) ?> brings up shoes

and <?php echo $_product->getAttributeText('company'); ?>" brings up company


texts: Restrict a controller HTTP Request by Cutomer email and password?

texts:
I had a similar question before, but I want to re-structure otherwise now.

I want to make something like http://icecat.biz/ In that site, I can access to XMLs with products datasheets, making a HTTP Request to:

http://data.icecat.biz/xml_s3/xml_server3.cgi

And sending my creedentials and the product sku. For example, using PHP and Zend Framework:

        $attributes = array('prod_id' => '*PRODUCT_SKU*', 'vendor' => '*PRODUCT_VENDOR_CODE*', 'lang' => 'EN', 'output' => 'productxml');

        try{
            $client = new Zend_Http_Client();
            $client->setMethod(Zend_Http_Client::GET);
            $client->setHeaders('Content-Type: text/xml; charset=UTF-8');
            $client->setUri('http://data.icecat.biz/xml_s3/xml_server3.cgi');
            $client->setParameterGet($attributes);
            $client->setAuth('*MyIcecataUser*', '*MyIcecatPassword*', Zend_Http_CLient::AUTH_BASIC);
            $response = $client->request();

Where:

PRODUCT_SKU is the SKU I want to read.
PRODUCT_VENDOR_CODE is the code of the vendor, for example HP.
MyIcecataUser is my user when I registered in Icecat.
MyIcecatPassword is the password of my user in Icecat.

The code return me a XML structure, with the datasheet of the product, but only when I send the valid User and Password.

So, I want to make something like that in Magento, but on the side of who delivers the information. In other words, my external customers could access to a XML with my products information, from its external systems automatically, but restricted by his email and password.

I made the XML, that is no the problem. But now, it is accessible for everyone, and I am looking for a solution to make it accessible only for customer already have a valid username and password for the site (note that the site is restricted, they can only be accessed by logging, and can not be registered on their own, we have to do it directly).

So, maybe someone say me that the better way is using the API, by SOAP or REST. But, from what I understand, if I have 5,000 customers, it means that I have to create 5,000 users API, plus the new ones to be registered. So I want to know if there is way to do something similar, but using the username and password with the customer already has, and not confuse them further with a additional user and password.

I do not know if I was clear or maybe it was too confused.


texts:
I use Porto theme at magento 2,

at cart page i see input text for coupon code too small (15px).
At /pub/static/version1537796083/frontend/Smartwave/porto/el_GR/css/styles-m.css is 100%

I need to edit it and change it to 220px.
But where is the css to edit it?


texts: Allow countries for websites is not working

texts:
I'm trying to configure 2 websites allowing only some countries for each website. For test I'll only allow "spain" for one website and "USA" for the other.

I'm using the VM of bitnami with Magento 2.1.5.

This is the config:

default scope:
http://i.imgur.com/GQOdMCz.png

website spain
http://i.imgur.com/gJjLzKQ.png

storeView Spain
http://i.imgur.com/avrMtph.png

website USA
http://i.imgur.com/XXy8eox.png

storeView USA
http://i.imgur.com/jj2aXqV.png

This are the checkouts:

Spanish website's checkout url: 172.16.1.246/es/checkout/

USA website's checkout url: 172.16.1.246/in_en/checkout/

Checkouts

http://i.imgur.com/4OY5Sc5.png

http://i.imgur.com/9SoONJ4.png

Displays the same...

I did all known commands: setup:upgrade, cache:clean, cache:flush, compile, set production, indexer:reindex, etc...

Am I doing something wrong? it has to work this functionality.

Why it displays the same config that spanish website? WHY?

In the DDBB I think it's correct:

mysql> select * from core_config_data where path like "%countr%";
+-----------+----------+----------+-------------------------+-------+
| config_id | scope    | scope_id | path                    | value |
+-----------+----------+----------+-------------------------+-------+
|       118 | websites |        1 | general/country/default | ES    |
|       119 | websites |        1 | general/country/allow   | ES    |
|       120 | websites |        2 | general/country/default | US    |
|       121 | websites |        2 | general/country/allow   | US    |
+-----------+----------+----------+-------------------------+-------+
4 rows in set (0.00 sec)

Thank you

EDIT: I set as default the USA website, and now both websites display only USA on the dropdown...


texts: Can I create a sub-module inside a module?

texts:
I have modules with inter-dependencies, such as

MyVendor_MyModule1: Account
MyVendor_MyModule2: Account
MyVendor_MyModule1: Auth
MyVendor_MyModule2: Auth
MyVendor_MyModule1: Config
MyVendor_MyModule2: Config

Accountnamespace contains common code for both MyModule1 and MyModule2.

Currently, I am having a duplicate code in both modules.

I want to make Account an independent module to reduce the code duplicacy.

How shall I move forward without messing with namespaces?

Edt:

  To be exact: My current scenario is \Cj\Amazon is 1 module.
  I am planning to break it into two modules, i.e. Cj\Amazon\Importer
  and \Cj\Amazon\Integration.

  Both uses the same authentication which
  is Cj\Amazon\Auth. But in Magento, we are restricted to use
  Vendor\Module pattern.

  Is there any way two have multi modules with
  same namespaces i.e in \Cj\Amazon\ ?


texts: Get associated products Price and Size from configurable product

texts:
I want to have in the product view page and in the category page a list with all size attribute and price for each configurable product. I use this code to display the size and is work perfect but I need to get the price too. How I can add the price for associated products in the following code.

Thank you

$ids = Mage::getModel('catalog/product_type_configurable')->getChildrenIds($_product->getId()); //get the children ids through a simple query
$attrs  = $_product->getTypeInstance(true)->getConfigurableAttributesAsArray($_product);
foreach($attrs as $attr) {
    if(0 == strcmp("size", $attr['attribute_code'])) {
        $options    = $attr['values'];
        foreach($options as $option) {
            print "{$option['store_label']}<br />";
        }
    }
}

I need to be something like in this image:

Edit:
I can get simple products prices with the following code but how I can have Size and Price foreach simple product?

if($_product->getTypeId() == "configurable"):
    $conf = Mage::getModel('catalog/product_type_configurable')->setProduct($_product);
    $simple_collection = $conf->getUsedProductCollection()->addAttributeToSelect('*')->addFilterByRequiredOptions();
    foreach($simple_collection as $simple_product){
        echo Mage::helper('core')->currency($simple_product->getPrice());
    }
endif;


texts: Magento 2 I have product id and attribute ids, How can i automatically select that attributes in particular product?

texts:
i am making one custom form where i am loading particular atrribute collection, and save attribute id in custom table with product id.
now at the moment when data save in custom table, i want that attribute automatically selected in product edit page backend.


texts: M2.1: Loading Products with Magento\Catalog\Block\Product\View

texts:
I want to load another Product on the catalog product view page using the the default Magento\Catalog\Block\Product\View Block and trying to load the product via SKU in an custom template file

<block class="Magento\Catalog\Block\Product\View" name="product.bundle.options" as="bundle.options" template="product/view/bundle-options.phtml" group="detailed_info">

I thought I could use the View.php because it uses the ProductRepository
inside Magento\Catalog\Block\Product\View.php:

use Magento\Catalog\Api\ProductRepositoryInterface Line: 8

ProductRepositoryInterface $productRepository Line: 89

and inside the Magento\Catalog\Api\ProductRepositoryInterface.php resides the function

 /**
 * Get info about product by product SKU
 *
 * @param string $sku
 * @param bool $editMode
 * @param int|null $storeId
 * @param bool $forceReload
 * @return \Magento\Catalog\Api\Data\ProductInterface
 * @throws \Magento\Framework\Exception\NoSuchEntityException
 */
public function get($sku, $editMode = false, $storeId = null, $forceReload = false);

Now trying to load the a product in the template file

<?php
    $sku = '235039';
    $product = $this->productRepository->get($sku);
    var_dump($product);
?>

Result: Page Breaks

trying to use $this->_productRepository->get($sku); (with underscore) give me this output:

1 exception(s): Exception #0 (Exception): Notice: Undefined property: Magento\Catalog\Block\Product\View\Interceptor::$_productRepository in /var/www/<magentoroot>/vendor/magento/framework/View/TemplateEngine/Php.php on line 110

Question:

do i have missed something? Why can't I load the product using the get Function. And I do not want to Integrate the Object Manager because the ProductRepository should be included in the View.php and I also do not want to create a own block using the Dependency Injection, just so I can load a product. I just want to use the default View.php. It should be possible, right?


texts:
I am interested in unit testing in magento and have started looking at the ecomdev module.

However, i dont think it is going to be possible to do full tdd with magento.  For the following scenarios how would you perform tdd:

Upgrade scripts in general
Specifically upgrade scripts adding product attributes and the likes
System xml and store config values
Core rewrites
Controllers
etc. etc.

I think there are a lot of scenarios that you cant perform tdd in magento.  Am i mistaken?

How are other people out there unit testing/tdd using Magento?


texts: MySQL error and possible duplicates running bin/magento setup:upgrade after renaming module

texts:
I've renamed a custom module from MagicPack_magicheader to MagicPack_Magicheader and trying to now update by running setup:upgrade. I get the following error:

  [Zend_Db_Statement_Exception]
  SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'MagicPack_Magicheader' for key 'PRIMARY', query was: INSERT INTO `setup_module` (`module`, `schema_version`) VALUES (?, ?)

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

On the site itself, it tells me to run upgrade, but I've noticed two entries:

The following modules are outdated:
MagicPack_Magicheader schema: current version - none, required version - 0.2.0
MagicPack_Magicheader data: current version - none, required version - 0.2.0

This seems to match the issue with duplicate entries. Can anyone let me know why there are duplicate entries, one for schema and one for data? The module.xml file is as follows:

<?xml version="1.0"?>

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

Thanks


texts: Magento 2 Join table customer entity and customer address entity

texts:
I am trying to join customer entity table and customer address entity table. I am getting error in below code.
What could be the issue

        $agency_name=$customerData->getDefaultShippingAddress()->getAgencyName();
        $objectManager = \Magento\Framework\App\ObjectManager::getInstance();

        $resource = $objectManager->get('Magento\Framework\App\ResourceConnection');
        $customerTable = $resource->getTableName('customer_entity');

$customerObj = $objectManager->create('Magento\Customer\Model\ResourceModel\Address\Collection');
$collection = $customerObj
             ->addAttributeToSelect('agency_name', 'customer_address_entity')
              ->addAttributeToFilter('agency_name',array('eq'=>$agency_name));
              //->load();

              $collection->getSelect()->join(['ct'=>$customerTable],'main_table.parent_id=ct.entity_id',[]);

$c_data=$collection->getData();
print_r($c_data);

Giving me error.Please Help


texts:
I would like to change the dropdown behaviour of navigation. Which files need to be changed?

I try to give the dropdown 100% width and place items inline

I see this file /vendor/magento/module-theme/view/frontend/templates/html/topmenu.phtml. How do I override this in a custom theme and how do I add .css and .js to it?


texts: How do I run php custom script on magento2

texts:
I wanted to add custom php script to magento2 root folder and run from the browser.I tried to add it in magento2 root folder but it redirects to 404 page.

I also tried to add it in pub folder but no success.

Also cleared cache and generation.

I am running magento2 on nginx server


texts: Magento sending blank token in paypal express checkout (#10410: Invalid token)

texts:
Every time I try to place order using Paypal Express for first time, It is showing the error:

  PayPal gateway has rejected request. Invalid token (#10410: Invalid token)

When I logged the data to see the parameter it is sending blank token and blank payerID.

    Array
    (
        [url] => https://api-3t.sandbox.paypal.com/nvp
        [DoExpressCheckoutPayment] => Array
            (
                [TOKEN] =>
                [PAYERID] =>
                [PAYMENTACTION] => Sale
                [AMT] => 11.00
                [CURRENCYCODE] => GBP
                [BUTTONSOURCE] => Varien_Cart_EC_UK
                [NOTIFYURL] => http://magento-ba.localhost/paypal/ipn/
                [RETURNFMFDETAILS] => 1
                [ITEMAMT] => 9.17
                [TAXAMT] => 1.83
                [SHIPPINGAMT] => 0.00
                [L_NUMBER0] => 100193-01BL34C
                [L_NAME0] => Chloe lace balconette bra
                [L_QTY0] => 1
                [L_AMT0] => 9.17
                [BUSINESS] =>
                [EMAIL] => amzadfof@gmail.com
                [FIRSTNAME] => amzad
                [LASTNAME] => mojumder
                [MIDDLENAME] =>
                [SALUTATION] =>
                [SUFFIX] =>
                [COUNTRYCODE] => GB
                [STATE] => -
                [CITY] => WOKING
                [STREET] => 44 Walton Court
                [ZIP] => GU21 5ED
                [PHONENUM] => 07900642141
                [SHIPTOCOUNTRYCODE] => GB
                [SHIPTOSTATE] => -
                [SHIPTOCITY] => WOKING
                [SHIPTOSTREET] => 44 Walton Court
                [SHIPTOZIP] => GU21 5ED
                [SHIPTOPHONENUM] => 07900642141
                [SHIPTOSTREET2] =>
                [STREET2] =>
                [SHIPTONAME] => amzad mojumder
                [ADDROVERRIDE] => 1
                [METHOD] => DoExpressCheckoutPayment
                [VERSION] => 72.0
                [USER] => ****
                [PWD] => ****
                [SIGNATURE] => ****
            )

        [response] => Array
            (
                [TIMESTAMP] => 2014-11-14T15:23:32Z
                [CORRELATIONID] => 9f6a2e2e72148
                [ACK] => Failure
                [VERSION] => 72.0
                [BUILD] => 13630372
                [L_ERRORCODE0] => 10410
                [L_SHORTMESSAGE0] => Invalid token
                [L_LONGMESSAGE0] => Invalid token.
                [L_SEVERITYCODE0] => Error
            )

        [__pid] => 3936
    )

Is it possible to to set token manually in the start of the express checkout? Or any solution for it? Any help will be greatly appreciated!


texts:
I ran the 6788 patch and it reported that everything had succeeded, everything looked fine on the front end of the site.

However on closer inspection the permissions tables had not been created and the admin pages to edit block and variable permissions had not been enabled either.

The error logs have this in:

exception 'Mage_Core_Exception' with message 'Can't retrieve entity config: admin/permission_block' in \app\Mage.php:595
Stack trace:
#0 \app\code\core\Mage\Core\Model\Resource.php(272): Mage::throwException('Can't retrieve ...')
#1 \app\code\core\Mage\Core\Model\Resource\Db\Abstract.php(284): Mage_Core_Model_Resource->getTableName('admin/permissio...')
#2 \app\code\core\Mage\Core\Model\Resource\Db\Abstract.php(247): Mage_Core_Model_Resource_Db_Abstract->getTable('permission_bloc...')
#3 \app\code\core\Mage\Core\Model\Resource\Db\Collection\Abstract.php(155): Mage_Core_Model_Resource_Db_Abstract->getMainTable()
#4 \app\code\core\Mage\Core\Model\Resource\Db\Collection\Abstract.php(192): Mage_Core_Model_Resource_Db_Collection_Abstract->getMainTable()
#5 \app\code\core\Mage\Core\Model\Resource\Db\Collection\Abstract.php(135): Mage_Core_Model_Resource_Db_Collection_Abstract->_initSelect()
#6 \app\code\core\Mage\Core\Model\Config.php(1354): Mage_Core_Model_Resource_Db_Collection_Abstract->__construct(Array)
#7 \app\code\core\Mage\Core\Model\Config.php(1386): Mage_Core_Model_Config->getModelInstance('admin_resource/...', Array)
#8 \app\Mage.php(491): Mage_Core_Model_Config->getResourceModelInstance('admin/block_col...', Array)
#9 \app\code\core\Mage\Admin\Model\Block.php(79): Mage::getResourceModel('admin/block_col...')
#10 \app\code\core\Mage\Core\Model\Email\Template\Filter.php(172): Mage_Admin_Model_Block->isTypeAllowed('catalog/navigat...')

I tried creating the tables manually, but this did not help.

I also tried setting the admin_setup version back to 1.6.1.1 to try to get the upgrade script to run again, but this seemed to have no effect either.

This is on Magento 1.8.1


texts: Magento 2 setting wrong file permissions?

texts: I'm adding products to my development website and I've noticed that images are not showing on the front end. After inspecting these, I can see that the chown user and group is correct but the file permissions of these images are set to 666. Is there a way I can make Magento correctly set these to 644 without having to set a cron job up?


texts: Magento 2.2.5 shell script PHP Memory size of 2097152 bytes exhausted (tried to allocate 32768 bytes)

texts:
I have a magento 2 script which runs through shell so to not have a timeout issue. It uses php multi curl request and it was running fine. But recently asked our hosting server to increase the PHP cli memory limit from 2048M to 16384M and php-fpm memory_limit was increased that too. And after that I tried running any magento command and we're getting the following error.

PHP Fatal error: Allowed memory size of 2097152 bytes exhausted (tried to allocate 32768 bytes) in /vendor/symfony/console/Application.php on line 710. How is this possible it was running fine before and the memory was increased and now this error is showing.

CentOS 7.3
Apache2 httpd-2.4.6-67.el7.centos.5.x86_64
Magento 2.2.5
PHP 7.1.14


texts: Magento 2 - bin/magento No commands working - Class 'Cli' not found Error

texts:
PHP Fatal error:  Class 'Cli' not found in
  /home/xxx-xxx/public_html/bin/magento on line 31

xxx-xxx@rck:~/public_html$ php bin/magento

No lock file found. Unable to read locked packages#0

  /home/xxx/public_html/vendor/composer/composer/src/Composer/Package/Locker.php(146):
  Composer\Package\Locker->getLockData()

  Magento\Framework\Console\Cli->__construct('Magento CLI')

I am trying following commands:

php bin/magento

php bin/magento setup:upgrade


texts: Directory of custom block in magento 2.1

texts:
I create a file custom block php.

Directory is: app\design\frontend\Vendor\default\Magento_Theme\Block\CustomBlock.php

CustomBlock.php:

class CustomBlock extends \Magento\Framework\View\Element\Template
{
    public function __construct(
        \Magento\Framework\View\Element\Template\Context $context,
        \Magento\Store\Model\Information $storeInfo,
        array $data = []
    )
    {
        $this->_storeInfo = $storeInfo;
        parent::__construct($context, $data);
    }
}

Define block xml:

<block class="Magento\Theme\Block\CustomBlock" name="...">
                <argument name="template" xsi:type="string">Magento_Theme::html/footer/footer.phtml</argument>
            </block>

But I get an exception:

Exception #0 (Magento\Framework\Exception\LocalizedException): Invalid block type: Magento\Theme\Block\CustomBlock
Exception #1 (ReflectionException): Class Magento\Theme\Block\CustomBlockdoes not exist

Please help me!